annotate clang/test/Parser/colon-colon-parentheses.cpp @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 %s -verify -fno-spell-checking
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 struct S { static int a,b,c;};
anatofuz
parents:
diff changeset
4 int S::(a); // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
5 int S::(b; // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
6 );
anatofuz
parents:
diff changeset
7 int S::c;
anatofuz
parents:
diff changeset
8 int S::(*d); // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
9 int S::(*e; // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
10 );
anatofuz
parents:
diff changeset
11 int S::*f;
anatofuz
parents:
diff changeset
12 int g = S::(a); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'a'}}
anatofuz
parents:
diff changeset
13 int h = S::(b; // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'b'}}
anatofuz
parents:
diff changeset
14 );
anatofuz
parents:
diff changeset
15 int i = S::c;
anatofuz
parents:
diff changeset
16
anatofuz
parents:
diff changeset
17 void foo() {
anatofuz
parents:
diff changeset
18 int a;
anatofuz
parents:
diff changeset
19 a = ::(g); // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
20 a = ::(h; // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
21 a = ::i;
anatofuz
parents:
diff changeset
22 }
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 // The following tests used to be crash bugs.
anatofuz
parents:
diff changeset
25
anatofuz
parents:
diff changeset
26 // PR21815
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
27 // expected-error@+2{{a type specifier is required for all declarations}}
150
anatofuz
parents:
diff changeset
28 // expected-error@+1{{expected unqualified-id}}
anatofuz
parents:
diff changeset
29 a (::( ));
anatofuz
parents:
diff changeset
30
anatofuz
parents:
diff changeset
31 ::((c )); // expected-error{{expected unqualified-id}}
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 // PR26623
anatofuz
parents:
diff changeset
34 int f1(::(B) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'B'}}
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 int f2(::S::(C) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'C'}}