2016-12-10 05:10:43 +08:00
|
|
|
// RUN: %clang_cc1 %s -verify -fno-spell-checking
|
2012-11-02 09:08:58 +08:00
|
|
|
|
|
|
|
struct S { static int a,b,c;};
|
2016-12-10 05:10:43 +08:00
|
|
|
int S::(a); // expected-error{{expected unqualified-id}}
|
|
|
|
int S::(b; // expected-error{{expected unqualified-id}}
|
|
|
|
);
|
2012-11-02 09:08:58 +08:00
|
|
|
int S::c;
|
2016-12-10 05:10:43 +08:00
|
|
|
int S::(*d); // expected-error{{expected unqualified-id}}
|
|
|
|
int S::(*e; // expected-error{{expected unqualified-id}}
|
|
|
|
);
|
2012-11-02 09:08:58 +08:00
|
|
|
int S::*f;
|
2016-12-10 05:10:43 +08:00
|
|
|
int g = S::(a); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'a'}}
|
|
|
|
int h = S::(b; // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'b'}}
|
|
|
|
);
|
2012-11-02 09:08:58 +08:00
|
|
|
int i = S::c;
|
|
|
|
|
|
|
|
void foo() {
|
|
|
|
int a;
|
2016-12-10 05:10:43 +08:00
|
|
|
a = ::(g); // expected-error{{expected unqualified-id}}
|
|
|
|
a = ::(h; // expected-error{{expected unqualified-id}}
|
2012-11-02 09:08:58 +08:00
|
|
|
a = ::i;
|
|
|
|
}
|
2014-12-17 09:39:22 +08:00
|
|
|
|
2016-12-10 05:10:43 +08:00
|
|
|
// The following tests used to be crash bugs.
|
|
|
|
|
|
|
|
// PR21815
|
2015-12-19 10:40:19 +08:00
|
|
|
// expected-error@+2{{C++ requires a type specifier for all declarations}}
|
|
|
|
// expected-error@+1{{expected unqualified-id}}
|
|
|
|
a (::( ));
|
|
|
|
|
|
|
|
::((c )); // expected-error{{expected unqualified-id}}
|
2016-12-10 05:10:43 +08:00
|
|
|
|
|
|
|
// PR26623
|
|
|
|
int f1(::(B) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'B'}}
|
|
|
|
|
|
|
|
int f2(::S::(C) p); // expected-error {{expected unqualified-id}} expected-error {{use of undeclared identifier 'C'}}
|