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 | |
Chris Lattner | a1efc8c | 2009-12-10 01:59:24 +0000 | [diff] [blame^] | 5 | struct Type { }; |
| 6 | |
Chris Lattner | 4664649 | 2009-12-07 01:36:53 +0000 | [diff] [blame] | 7 | |
| 8 | // PR4451 - We should recover well from the typo of '::' as ':' in a2. |
| 9 | namespace y { |
| 10 | struct a { }; |
| 11 | } |
| 12 | |
| 13 | y::a a1; |
| 14 | y:a a2; // expected-error {{unexpected ':' in nested name specifier}} |
| 15 | y::a a3 = a2; |
| 16 | |
| 17 | // Some valid colons: |
| 18 | void foo() { |
| 19 | y: // label |
| 20 | y::a s; |
| 21 | |
| 22 | int a = 4; |
| 23 | a = a ? a : a+1; |
| 24 | } |
| 25 | |
| 26 | struct b : y::a {}; |
| 27 | |
| 28 | template <typename T> |
| 29 | class someclass { |
| 30 | |
| 31 | int bar() { |
| 32 | T *P; |
| 33 | return 1 ? P->x : P->y; |
| 34 | } |
| 35 | }; |
Chris Lattner | a1efc8c | 2009-12-10 01:59:24 +0000 | [diff] [blame^] | 36 | |
| 37 | enum { fooenum = 1 }; |
| 38 | |
| 39 | struct a { |
| 40 | int Type : fooenum; |
| 41 | }; |
| 42 | |