Chris Lattner | 8129edb | 2009-04-12 22:23:27 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -verify -fsyntax-only %s |
| 2 | |
| 3 | int x(*g); // expected-error {{use of undeclared identifier 'g'}} |
Chris Lattner | 4664649 | 2009-12-07 01:36:53 +0000 | [diff] [blame^] | 4 | |
| 5 | |
| 6 | // PR4451 - We should recover well from the typo of '::' as ':' in a2. |
| 7 | namespace y { |
| 8 | struct a { }; |
| 9 | } |
| 10 | |
| 11 | y::a a1; |
| 12 | y:a a2; // expected-error {{unexpected ':' in nested name specifier}} |
| 13 | y::a a3 = a2; |
| 14 | |
| 15 | // Some valid colons: |
| 16 | void foo() { |
| 17 | y: // label |
| 18 | y::a s; |
| 19 | |
| 20 | int a = 4; |
| 21 | a = a ? a : a+1; |
| 22 | } |
| 23 | |
| 24 | struct b : y::a {}; |
| 25 | |
| 26 | template <typename T> |
| 27 | class someclass { |
| 28 | |
| 29 | int bar() { |
| 30 | T *P; |
| 31 | return 1 ? P->x : P->y; |
| 32 | } |
| 33 | }; |