Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify -DPR21815 |
Richard Trieu | 919b955 | 2012-11-02 01:08:58 +0000 | [diff] [blame] | 2 | // RUN: cp %s %t |
| 3 | // RUN: not %clang_cc1 -x c++ -fixit %t |
| 4 | // RUN: %clang_cc1 -x c++ %t |
| 5 | |
| 6 | struct S { static int a,b,c;}; |
Richard Trieu | eacff03 | 2012-11-02 21:41:42 +0000 | [diff] [blame] | 7 | int S::(a); // expected-error{{unexpected parenthesis after '::'}} |
| 8 | int S::(b; // expected-error{{unexpected parenthesis after '::'}} |
Richard Trieu | 919b955 | 2012-11-02 01:08:58 +0000 | [diff] [blame] | 9 | int S::c; |
Richard Trieu | eacff03 | 2012-11-02 21:41:42 +0000 | [diff] [blame] | 10 | int S::(*d); // expected-error{{unexpected parenthesis after '::'}} |
| 11 | int S::(*e; // expected-error{{unexpected parenthesis after '::'}} |
Richard Trieu | 919b955 | 2012-11-02 01:08:58 +0000 | [diff] [blame] | 12 | int S::*f; |
Richard Trieu | eacff03 | 2012-11-02 21:41:42 +0000 | [diff] [blame] | 13 | int g = S::(a); // expected-error{{unexpected parenthesis after '::'}} |
| 14 | int h = S::(b; // expected-error{{unexpected parenthesis after '::'}} |
Richard Trieu | 919b955 | 2012-11-02 01:08:58 +0000 | [diff] [blame] | 15 | int i = S::c; |
| 16 | |
| 17 | void foo() { |
| 18 | int a; |
Richard Trieu | eacff03 | 2012-11-02 21:41:42 +0000 | [diff] [blame] | 19 | a = ::(g); // expected-error{{unexpected parenthesis after '::'}} |
| 20 | a = ::(h; // expected-error{{unexpected parenthesis after '::'}} |
Richard Trieu | 919b955 | 2012-11-02 01:08:58 +0000 | [diff] [blame] | 21 | a = ::i; |
| 22 | } |
Stephen Hines | 0e2c34f | 2015-03-23 12:09:02 -0700 | [diff] [blame] | 23 | |
| 24 | #ifdef PR21815 |
| 25 | // expected-error@+4{{C++ requires a type specifier for all declarations}} |
| 26 | // expected-error@+3{{expected unqualified-id}} |
| 27 | // expected-error@+3{{expected expression}} |
| 28 | // expected-error@+1{{expected ';' after top level declarator}} |
| 29 | a (::( |
| 30 | #endif |