From f80df57d3984ef5bacd6b347bfadf606c9502f13 Mon Sep 17 00:00:00 2001 From: Serge Pavlov Date: Sun, 18 Jan 2015 19:05:48 +0000 Subject: [PATCH] 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 --- .../include/clang/Basic/DiagnosticSemaKinds.td | 4 ++-- .../basic.lookup.qual/class.qual/p2.cpp | 2 +- .../expr/expr.prim/expr.prim.general/p8-0x.cpp | 4 ++-- clang/test/CXX/temp/temp.res/temp.local/p3.cpp | 2 +- clang/test/Parser/recovery.cpp | 18 +++++++++--------- clang/test/SemaCXX/constructor-initializer.cpp | 2 +- clang/test/SemaCXX/member-pointer.cpp | 2 +- clang/test/SemaCXX/nested-name-spec.cpp | 10 +++++----- clang/test/SemaObjCXX/propert-dot-error.mm | 4 ++-- .../instantiate-non-dependent-types.cpp | 2 +- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 86ff9aee3e4f..1bcd702ad8c3 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -1230,7 +1230,7 @@ def warn_cxx98_compat_enum_nested_name_spec : Warning< InGroup, 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< diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp index b9e83988cfb8..d1562d4cd18b 100644 --- a/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp +++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.qual/class.qual/p2.cpp @@ -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 struct UsingIntTemplate { using T::T; // expected-error {{type 'int' cannot be used prior to '::' because it has no members}} diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.general/p8-0x.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.general/p8-0x.cpp index 5b3a004056b5..b5cd98828cc9 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.general/p8-0x.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.general/p8-0x.cpp @@ -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(); diff --git a/clang/test/CXX/temp/temp.res/temp.local/p3.cpp b/clang/test/CXX/temp/temp.res/temp.local/p3.cpp index e29ced19bc4f..d5e378660596 100644 --- a/clang/test/CXX/temp/temp.res/temp.local/p3.cpp +++ b/clang/test/CXX/temp/temp.res/temp.local/p3.cpp @@ -15,7 +15,7 @@ template struct Derived: Base, Base { t->Base::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}} } }; diff --git a/clang/test/Parser/recovery.cpp b/clang/test/Parser/recovery.cpp index 5608b5046825..e53a361dca80 100644 --- a/clang/test/Parser/recovery.cpp +++ b/clang/test/Parser/recovery.cpp @@ -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 { diff --git a/clang/test/SemaCXX/constructor-initializer.cpp b/clang/test/SemaCXX/constructor-initializer.cpp index 81dc19ea6dfc..64b503d08658 100644 --- a/clang/test/SemaCXX/constructor-initializer.cpp +++ b/clang/test/SemaCXX/constructor-initializer.cpp @@ -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}} }; diff --git a/clang/test/SemaCXX/member-pointer.cpp b/clang/test/SemaCXX/member-pointer.cpp index b8631bcf3efc..f8834e37de30 100644 --- a/clang/test/SemaCXX/member-pointer.cpp +++ b/clang/test/SemaCXX/member-pointer.cpp @@ -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}} diff --git a/clang/test/SemaCXX/nested-name-spec.cpp b/clang/test/SemaCXX/nested-name-spec.cpp index bdeb00d35734..15d63e10a910 100644 --- a/clang/test/SemaCXX/nested-name-spec.cpp +++ b/clang/test/SemaCXX/nested-name-spec.cpp @@ -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 { diff --git a/clang/test/SemaObjCXX/propert-dot-error.mm b/clang/test/SemaObjCXX/propert-dot-error.mm index e28204c665fc..02e7dddb8c5d 100644 --- a/clang/test/SemaObjCXX/propert-dot-error.mm +++ b/clang/test/SemaObjCXX/propert-dot-error.mm @@ -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}} } diff --git a/clang/test/SemaTemplate/instantiate-non-dependent-types.cpp b/clang/test/SemaTemplate/instantiate-non-dependent-types.cpp index 432b9053bdca..1efd2a5844e8 100644 --- a/clang/test/SemaTemplate/instantiate-non-dependent-types.cpp +++ b/clang/test/SemaTemplate/instantiate-non-dependent-types.cpp @@ -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'}}