1 // RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
3 // RUN: %clang_cc1 -fsyntax-only -verify %s
11 enum class EC
{ ec
}; // expected-warning 0-1 {{C++11}}
31 using C::g
; // expected-error{{using declaration refers into 'C::', which is not a base class of 'D2'}}
33 // These are valid in C++98 but not in C++11.
38 #if __cplusplus >= 201103L
39 // expected-error@-5 {{using declaration refers into 'D::', which is not a base class of 'D2'}}
40 // expected-error@-5 {{using declaration refers into 'D::', which is not a base class of 'D2'}}
41 // expected-error@-5 {{using declaration refers into 'D::', which is not a base class of 'D2'}}
42 // expected-error@-5 {{using declaration refers into 'D::', which is not a base class of 'D2'}}
46 using B::EC::ec
; // expected-warning {{a C++20 extension}} expected-warning 0-1 {{C++11}}
58 struct Subclass
: Base
{
68 // We should be able to diagnose these without instantiation.
69 template <class T
> struct C
: Base
{
70 using InnerNS::foo
; // expected-error {{not a class}}
71 using Base::bar
; // expected-error {{no member named 'bar'}}
72 using Unrelated::foo
; // expected-error {{not a base class}}
74 // In C++98, it's hard to see that these are invalid, because indirect
75 // references to base class members are permitted.
78 #if __cplusplus >= 201103L
79 // expected-error@-3 {{refers to its own class}}
80 // expected-error@-3 {{not a base class}}