1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
3 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
10 #if __cplusplus <= 199711L
11 // expected-note@-2 {{lookup in the object type 'A::sub' refers here}}
26 member
* operator->() { return 0; }
32 middleman
operator->() { return middleman(); }
52 a
.B::base::x(); // expected-error{{use of undeclared identifier 'B'}}
57 a
.bad::x(); // expected-error{{'bad::x' is not a member of class 'A::sub'}}
73 a
->B::base::x(); // expected-error{{use of undeclared identifier 'B'}}
78 a
->bad::x(); // expected-error{{'bad::x' is not a member of class 'A::sub'}}
82 (*a
)->A::member::foo();
88 i
.foo(); // expected-error{{member reference base type 'int' is not a structure or union}}
94 typedef A::member base
;
95 #if __cplusplus <= 199711L
96 // expected-note@-2 {{lookup from the current scope refers here}}
99 #if __cplusplus <= 199711L
100 // expected-error@-2 {{lookup of 'base' in member access expression is ambiguous}}
107 typedef A::B::base base
;
122 a
.bad::x(); // expected-error{{'bad::x' is not a member of class 'A::sub'}}
126 fun5
<A::sub
>(); // expected-note{{instantiation}}
135 a
.B::base::x(); // expected-error{{use of undeclared identifier 'B'}}
139 fun6
<A::sub
>(); // expected-note{{instantiation}}
152 int a::sa
= a
.a
; // expected-error {{invalid use of non-static data member 'a'}}
158 typedef int PR6645::foo
; // expected-error{{typedef declarator cannot be qualified}} \
159 // expected-error{{cannot define or redeclare 'foo' here because namespace 'Inner' does not enclose namespace 'PR6645'}}