diff options
| author | Richard Trieu <rtrieu@google.com> | 2011-12-15 00:38:15 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2011-12-15 00:38:15 +0000 |
| commit | 553b2b2e5dde2839618edbc7b60f6c0677774853 (patch) | |
| tree | 939113f97b1097c1629ec5d75d3b84be7e3b6582 /clang/test/CXX/class | |
| parent | 0b144e160a3129708d1494e88d614cdce2867160 (diff) | |
| download | bcm5719-llvm-553b2b2e5dde2839618edbc7b60f6c0677774853.tar.gz bcm5719-llvm-553b2b2e5dde2839618edbc7b60f6c0677774853.zip | |
Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:
// expect-error{{candidate function has different number of parameters}}
will match the following error messages from Clang:
candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters
It will also match these other error messages:
candidate function
function has different number of parameters
number of parameters
This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:
87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)
llvm-svn: 146619
Diffstat (limited to 'clang/test/CXX/class')
| -rw-r--r-- | clang/test/CXX/class/class.friend/p1.cpp | 18 | ||||
| -rw-r--r-- | clang/test/CXX/class/class.mem/p13.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CXX/class/class.nest/p1-cxx0x.cpp | 2 | ||||
| -rw-r--r-- | clang/test/CXX/class/class.nest/p1.cpp | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/clang/test/CXX/class/class.friend/p1.cpp b/clang/test/CXX/class/class.friend/p1.cpp index bb1af101d24..56337ec25f4 100644 --- a/clang/test/CXX/class/class.friend/p1.cpp +++ b/clang/test/CXX/class/class.friend/p1.cpp @@ -29,35 +29,35 @@ class A { friend class PreDeclared; friend class Outer::Inner; - friend int Outer::Inner::intfield; // expected-error {{ friends can only be classes or functions }} - friend int Outer::Inner::missing_field; //expected-error {{ friends can only be classes or functions }} + friend int Outer::Inner::intfield; // expected-error {{friends can only be classes or functions}} + friend int Outer::Inner::missing_field; //expected-error {{friends can only be classes or functions}} friend int myoperation(float); // okay - friend int myglobal; // expected-error {{ friends can only be classes or functions }} + friend int myglobal; // expected-error {{friends can only be classes or functions}} friend void global_function(); friend void global_c_function(); friend class UndeclaredSoFar; - UndeclaredSoFar x; // expected-error {{ unknown type name 'UndeclaredSoFar' }} + UndeclaredSoFar x; // expected-error {{unknown type name 'UndeclaredSoFar'}} void a_member(); - friend void A::a_member(); // expected-error {{ friends cannot be members of the declaring class }} + friend void A::a_member(); // expected-error {{friends cannot be members of the declaring class}} friend void a_member(); // okay (because we ignore class scopes when looking up friends) friend class A::AInner; // this is okay as an extension friend class AInner; // okay, refers to ::AInner - friend void Derived::missing_member(); // expected-error {{ no function named 'missing_member' with type 'void ()' was found in the specified scope }} + friend void Derived::missing_member(); // expected-error {{no function named 'missing_member' with type 'void ()' was found in the specified scope}} - friend void Derived::base_member(); // expected-error {{ no function named 'base_member' with type 'void ()' was found in the specified scope }} + friend void Derived::base_member(); // expected-error {{no function named 'base_member' with type 'void ()' was found in the specified scope}} friend int Base::typedeffed_member(); // okay: should look through typedef // These test that the friend is properly not being treated as a // member function. friend A operator|(const A& l, const A& r); // okay - friend A operator|(const A& r); // expected-error {{ overloaded 'operator|' must be a binary operator (has 1 parameter) }} + friend A operator|(const A& r); // expected-error {{overloaded 'operator|' must be a binary operator (has 1 parameter)}} - friend operator bool() const; // expected-error {{ must use a qualified name when declaring a conversion operator as a friend }} \ + friend operator bool() const; // expected-error {{must use a qualified name when declaring a conversion operator as a friend}} \ // expected-error{{type qualifier is not allowed on this function}} typedef void ftypedef(); diff --git a/clang/test/CXX/class/class.mem/p13.cpp b/clang/test/CXX/class/class.mem/p13.cpp index 7cded23878e..84885848870 100644 --- a/clang/test/CXX/class/class.mem/p13.cpp +++ b/clang/test/CXX/class/class.mem/p13.cpp @@ -17,7 +17,7 @@ struct X1 { // expected-note{{previous use is here}} }; struct X2 { - typedef int X2; // expected-error{{member 'X2' has the same name as its class)}} + typedef int X2; // expected-error{{member 'X2' has the same name as its class}} }; // - every enumerator of every member of class T that is an enumerated type; and diff --git a/clang/test/CXX/class/class.nest/p1-cxx0x.cpp b/clang/test/CXX/class/class.nest/p1-cxx0x.cpp index 0f12579ee4f..b7a1a48c64f 100644 --- a/clang/test/CXX/class/class.nest/p1-cxx0x.cpp +++ b/clang/test/CXX/class/class.nest/p1-cxx0x.cpp @@ -9,6 +9,6 @@ class Outer { class Inner { static char a[sizeof(x)]; // okay static char b[sizeof(sx)]; // okay - static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }} + static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}} }; }; diff --git a/clang/test/CXX/class/class.nest/p1.cpp b/clang/test/CXX/class/class.nest/p1.cpp index 350cc814e9b..9eaeff07345 100644 --- a/clang/test/CXX/class/class.nest/p1.cpp +++ b/clang/test/CXX/class/class.nest/p1.cpp @@ -7,8 +7,8 @@ class Outer { // C++0x does relax this rule (see 5.1.1.10) in the first case, but we need to enforce it in C++03 mode. class Inner { - static char a[sizeof(x)]; // expected-error {{ invalid use of nonstatic data member 'x' }} + static char a[sizeof(x)]; // expected-error {{invalid use of nonstatic data member 'x'}} static char b[sizeof(sx)]; // okay - static char c[sizeof(f)]; // expected-error {{ call to non-static member function without an object argument }} + static char c[sizeof(f)]; // expected-error {{call to non-static member function without an object argument}} }; }; |

