InGroup<CXX98Compat>, DefaultIgnore;
def err_nested_name_spec_is_not_class : Error<
"%0 cannot appear before '::' because it is not a class"
- "%select{ or namespace|, namespace, or scoped enumeration}1; did you mean ':'?">;
+ "%select{ or namespace|, namespace, or enumeration}1; did you mean ':'?">;
// C++ class members
def err_storageclass_invalid_for_member : Error<
"invokes a deleted function">;
def err_expected_class_or_namespace : Error<"%0 is not a class"
- "%select{ or namespace|, namespace, or scoped enumeration}1">;
+ "%select{ or namespace|, namespace, or enumeration}1">;
def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
"because namespace %1 does not enclose namespace %2">;
def err_invalid_declarator_global_scope : Error<
// FIXME: Consider reusing the same diagnostic between dependent and non-dependent contexts
typedef int I;
struct UsingInt {
- using I::I; // expected-error {{'I' (aka 'int') is not a class, namespace, or scoped enumeration}}
+ using I::I; // expected-error {{'I' (aka 'int') is not a class, namespace, or enumeration}}
};
template<typename T> struct UsingIntTemplate {
using T::T; // expected-error {{type 'int' cannot be used prior to '::' because it has no members}}
decltype()::middle::fail g; // expected-error{{expected expression}}
decltype(int()) h;
- decltype(int())::PR10127::outer i; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or scoped enumeration}}
- decltype(int())::global j; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or scoped enumeration}}
+ decltype(int())::PR10127::outer i; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or enumeration}}
+ decltype(int())::global j; // expected-error{{'decltype(int())' (aka 'int') is not a class, namespace, or enumeration}}
outer::middle k = decltype(outer())::middle();
outer::middle::inner l = decltype(outer())::middle::inner();
t->Base<T>::f();
t->Base::f(); // expected-error{{member 'Base' found in multiple base classes of different types}} \
// expected-error{{no member named 'f' in 'X0'}} \
- // expected-error{{'Base' is not a class, namespace, or scoped enumeration}}
+ // expected-error{{'Base' is not a class, namespace, or enumeration}}
}
};
void func_1(int x) {
switch(x) {
case 0: break;
- case ns::V1:: break; // expected-error{{'V1' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
- case C1::V2:: break; // expected-error{{'V2' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
- case C1::V3:: break; // expected-error{{'V3' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
- case V4:: break; // expected-error{{'V4' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
- case V6:: func_3(); // expected-error{{'V6' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
+ case ns::V1:: break; // expected-error{{'V1' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
+ case C1::V2:: break; // expected-error{{'V2' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
+ case C1::V3:: break; // expected-error{{'V3' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
+ case V4:: break; // expected-error{{'V4' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
+ case V6:: func_3(); // expected-error{{'V6' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
}
}
void func_2(EC3 x) {
switch(x) {
case EC3::V0: break;
- case EC3::V5:: break; // expected-error{{'V5' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
+ case EC3::V5:: break; // expected-error{{'V5' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
}
}
};
int func_3(int x) {
- return x ? S::n :: 0; // expected-error{{'n' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
+ return x ? S::n :: 0; // expected-error{{'n' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
}
int func_4(int x, S &s) {
- return x ? s.nn :: x; // expected-error{{'nn' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
+ return x ? s.nn :: x; // expected-error{{'nn' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
}
int func_5(int x, S &s) {
- return x ? s.nn :: S::n; // expected-error{{'nn' cannot appear before '::' because it is not a class, namespace, or scoped enumeration; did you mean ':'?}}
+ return x ? s.nn :: S::n; // expected-error{{'nn' cannot appear before '::' because it is not a class, namespace, or enumeration; did you mean ':'?}}
}
struct S2 {
Derived::Base1(), // expected-error {{type 'Derived::Base1' is not a direct or virtual base of 'Current'}}
Derived::V(),
::NonExisting(), // expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
- INT::NonExisting() {} // expected-error {{'INT' (aka 'int') is not a class, namespace, or scoped enumeration}} \
+ INT::NonExisting() {} // expected-error {{'INT' (aka 'int') is not a class, namespace, or enumeration}} \
// expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
};
int (::A::*pdi2);
int (A::*pfi)(int);
-int B::*pbi; // expected-error {{'B' is not a class, namespace, or scoped enumeration}}
+int B::*pbi; // expected-error {{'B' is not a class, namespace, or enumeration}}
int C::*pci; // expected-error {{'pci' does not point into a class}}
void A::*pdv; // expected-error {{'pdv' declared as a member pointer to void}}
int& A::*pdr; // expected-error {{'pdr' declared as a member pointer to a reference}}
}
A:: ; // expected-error {{expected unqualified-id}}
-::A::ax::undef ex3; // expected-error {{'ax' is not a class, namespace, or scoped enumeration}}
+::A::ax::undef ex3; // expected-error {{'ax' is not a class, namespace, or enumeration}}
A::undef1::undef2 ex4; // expected-error {{no member named 'undef1'}}
int A::C::Ag1() { return 0; }
// declared here", "template 'X' declared here", etc) to help explain what it
// is if it's 'not a class, namespace, or scoped enumeration'.
int N; // expected-note {{'N' declared here}}
- N::x = 0; // expected-error {{'N' is not a class, namespace, or scoped enumeration}}
+ N::x = 0; // expected-error {{'N' is not a class, namespace, or enumeration}}
{ int A; A::ax = 0; }
- { typedef int A; A::ax = 0; } // expected-error{{'A' (aka 'int') is not a class, namespace, or scoped enumeration}}
+ { typedef int A; A::ax = 0; } // expected-error{{'A' (aka 'int') is not a class, namespace, or enumeration}}
{ typedef A::C A; A::ax = 0; } // expected-error {{no member named 'ax'}}
{ typedef A::C A; A::cx = 0; }
}
};
void f() {
- return E::X; // expected-error{{'E::Nested::E' is not a class, namespace, or scoped enumeration}}
+ return E::X; // expected-error{{'E::Nested::E' is not a class, namespace, or enumeration}}
}
}
}
}
namespace TypedefNamespace { typedef int F; };
-TypedefNamespace::F::NonexistentName BadNNSWithCXXScopeSpec; // expected-error {{'F' (aka 'int') is not a class, namespace, or scoped enumeration}}
+TypedefNamespace::F::NonexistentName BadNNSWithCXXScopeSpec; // expected-error {{'F' (aka 'int') is not a class, namespace, or enumeration}}
namespace PR18587 {
void testD(D *d) {
d.Forward::property = 17; // expected-error{{property access cannot be qualified with 'Forward::'}}
d->Forward::ivar = 12; // expected-error{{instance variable access cannot be qualified with 'Forward::'}}
- d.D::property = 17; // expected-error{{'D' is not a class, namespace, or scoped enumeration}}
- d->D::ivar = 12; // expected-error{{'D' is not a class, namespace, or scoped enumeration}}
+ d.D::property = 17; // expected-error{{'D' is not a class, namespace, or enumeration}}
+ d->D::ivar = 12; // expected-error{{'D' is not a class, namespace, or enumeration}}
}
T *q = new T();
t.T::~T();
q->~T();
- // expected-error@+2 {{'int' is not a class, namespace, or scoped enumeration}}
+ // expected-error@+2 {{'int' is not a class, namespace, or enumeration}}
// expected-error@+1 {{no member named '~Colors' in 'Colors'}}
q->A::~A();
// expected-error@+2 {{no member named '~int' in 'Q'}}