[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / colon-colon-parentheses.cpp
blob018fa7f20e5210e4c7d44033a854624fce5cab0d
1 // RUN: %clang_cc1 %s -verify -fno-spell-checking
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}}
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 ); // expected-error {{expected unqualified-id}}
15 int i = S::c;
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;
24 // The following tests used to be crash bugs.
26 // PR21815
27 // expected-error@+2{{a type specifier is required for all declarations}}
28 // expected-error@+1{{expected unqualified-id}}
29 a (::( ));
31 ::((c )); // expected-error{{expected unqualified-id}}
33 // PR26623
34 int f1(::(B) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'B'}}
36 int f2(::S::(C) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'C'}}