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/SemaCXX/class.cpp | |
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/SemaCXX/class.cpp')
-rw-r--r-- | clang/test/SemaCXX/class.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp index 5393230f5db..30b977913ac 100644 --- a/clang/test/SemaCXX/class.cpp +++ b/clang/test/SemaCXX/class.cpp @@ -1,14 +1,14 @@ // RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s class C { public: - auto int errx; // expected-error {{error: storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}} - register int erry; // expected-error {{error: storage class specified for a member declaration}} - extern int errz; // expected-error {{error: storage class specified for a member declaration}} + auto int errx; // expected-error {{storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}} + register int erry; // expected-error {{storage class specified for a member declaration}} + extern int errz; // expected-error {{storage class specified for a member declaration}} static void sm() { sx = 0; - this->x = 0; // expected-error {{error: invalid use of 'this' outside of a nonstatic member function}} - x = 0; // expected-error {{error: invalid use of member 'x' in static member function}} + this->x = 0; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + x = 0; // expected-error {{invalid use of member 'x' in static member function}} } class NestedC { @@ -46,7 +46,7 @@ public: sx = 0; this->x = 0; y = 0; - this = 0; // expected-error {{error: expression is not assignable}} + this = 0; // expected-error {{expression is not assignable}} } int f1(int p) { @@ -57,7 +57,7 @@ public: typedef int A; virtual int viv; // expected-error {{'virtual' can only appear on non-static member functions}} - virtual static int vsif(); // expected-error {{error: 'virtual' can only appear on non-static member functions}} + virtual static int vsif(); // expected-error {{'virtual' can only appear on non-static member functions}} virtual int vif(); private: @@ -65,9 +65,9 @@ private: static int sx; mutable int mi; - mutable int &mir; // expected-error {{error: 'mutable' cannot be applied to references}} - mutable void mfn(); // expected-error {{error: 'mutable' cannot be applied to functions}} - mutable const int mci; // expected-error {{error: 'mutable' and 'const' cannot be mixed}} + mutable int &mir; // expected-error {{'mutable' cannot be applied to references}} + mutable void mfn(); // expected-error {{'mutable' cannot be applied to functions}} + mutable const int mci; // expected-error {{'mutable' and 'const' cannot be mixed}} static const int number = 50; static int arr[number]; @@ -98,11 +98,11 @@ void f() } // Play with mutable a bit more, to make sure it doesn't crash anything. -mutable int gi; // expected-error {{error: 'mutable' can only be applied to member variables}} +mutable int gi; // expected-error {{'mutable' can only be applied to member variables}} mutable void gfn(); // expected-error {{illegal storage class on function}} void ogfn() { - mutable int ml; // expected-error {{error: 'mutable' can only be applied to member variables}} + mutable int ml; // expected-error {{'mutable' can only be applied to member variables}} // PR3020: This used to crash due to double ownership of C4. struct C4; |