mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 20:20:54 +00:00
Update error message text.
Previously if an enumeration was used in a nested name specifier in pre-C++11 language dialect, error message was 'XXX is not a class, namespace, or scoped enumeration'. This patch removes the word 'scoped' as in C++11 any enumeration may be used in this context. llvm-svn: 226410
This commit is contained in:
parent
01dce6c931
commit
f80df57d39
@ -1230,7 +1230,7 @@ def warn_cxx98_compat_enum_nested_name_spec : Warning<
|
||||
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<
|
||||
@ -5609,7 +5609,7 @@ def err_typecheck_deleted_function : 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<
|
||||
|
@ -108,7 +108,7 @@ namespace InhCtor {
|
||||
// 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}}
|
||||
|
@ -47,8 +47,8 @@ namespace PR10127 {
|
||||
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();
|
||||
|
@ -15,7 +15,7 @@ template <class T> struct Derived: Base<int>, Base<char> {
|
||||
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}}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -154,17 +154,17 @@ namespace pr15133 {
|
||||
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 ':'?}}
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,13 +186,13 @@ namespace pr15133 {
|
||||
};
|
||||
|
||||
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 {
|
||||
|
@ -94,7 +94,7 @@ struct Current : Derived {
|
||||
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}}
|
||||
};
|
||||
|
||||
|
@ -13,7 +13,7 @@ int A::*pdi1;
|
||||
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}}
|
||||
|
@ -13,7 +13,7 @@ namespace A {
|
||||
}
|
||||
|
||||
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; }
|
||||
@ -88,9 +88,9 @@ void f3() {
|
||||
// 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; }
|
||||
}
|
||||
@ -116,7 +116,7 @@ namespace E {
|
||||
};
|
||||
|
||||
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}}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -310,7 +310,7 @@ namespace N {
|
||||
}
|
||||
|
||||
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 {
|
||||
|
||||
|
@ -64,6 +64,6 @@ class Forward;
|
||||
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}}
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ public:
|
||||
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'}}
|
||||
|
Loading…
Reference in New Issue
Block a user