1 // RUN: %clang_cc1 %s -verify -fno-spell-checking
2
3 struct S { static int a,b,c;};
4 int S::(a); // expected-error{{expected unqualified-id}}
5 int S::(b; // expected-error{{expected unqualified-id}}
6 );
7 int S::c;
8 int S::(*d); // expected-error{{expected unqualified-id}}
9 int S::(*e; // expected-error{{expected unqualified-id}}
10 );
11 int S::*f;
12 int g = S::(a); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'a'}}
13 int h = S::(b; // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'b'}}
14 );
15 int i = S::c;
16
foo()17 void foo() {
18 int a;
19 a = ::(g); // expected-error{{expected unqualified-id}}
20 a = ::(h; // expected-error{{expected unqualified-id}}
21 a = ::i;
22 }
23
24 // The following tests used to be crash bugs.
25
26 // PR21815
27 // expected-error@+2{{C++ requires a type specifier for all declarations}}
28 // expected-error@+1{{expected unqualified-id}}
29 a (::( ));
30
31 ::((c )); // expected-error{{expected unqualified-id}}
32
33 // PR26623
34 int f1(::(B) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'B'}}
35
36 int f2(::S::(C) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'C'}}
37