diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/class/class.nest/p1.cpp | 4 | ||||
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp | 2 | ||||
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp | 4 | ||||
-rw-r--r-- | clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp | 2 | ||||
-rw-r--r-- | clang/test/CXX/special/class.free/p1.cpp | 4 | ||||
-rw-r--r-- | clang/test/CXX/special/class.free/p6.cpp | 4 | ||||
-rw-r--r-- | clang/test/Parser/cxx-typeof.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaCXX/class.cpp | 10 | ||||
-rw-r--r-- | clang/test/SemaCXX/default2.cpp | 10 | ||||
-rw-r--r-- | clang/test/SemaCXX/qual-id-test.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaCXX/this.cpp | 4 |
11 files changed, 25 insertions, 23 deletions
diff --git a/clang/test/CXX/class/class.nest/p1.cpp b/clang/test/CXX/class/class.nest/p1.cpp index 9eaeff07345..b0341da7c21 100644 --- a/clang/test/CXX/class/class.nest/p1.cpp +++ b/clang/test/CXX/class/class.nest/p1.cpp @@ -5,9 +5,9 @@ class Outer { static int sx; int f(); - // 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. + // C++11 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 non-static 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}} }; diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp index 606300b1b2f..249c9764608 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.general/p12-0x.cpp @@ -26,7 +26,7 @@ namespace std { } class Poly { virtual ~Poly(); }; const std::type_info& k = typeid(S::m); -const std::type_info& m = typeid(*(Poly*)S::m); // expected-error {{invalid use of nonstatic data member}} +const std::type_info& m = typeid(*(Poly*)S::m); // expected-error {{invalid use of non-static data member}} const std::type_info& n = typeid(*(Poly*)(0*sizeof S::m)); namespace PR11956 { diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp index b9f0414e917..4e57b74f08a 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.general/p4-0x.cpp @@ -2,9 +2,9 @@ struct S { S *p = this; // ok - decltype(this) q; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + decltype(this) q; // expected-error {{invalid use of 'this' outside of a non-static member function}} - int arr[sizeof(this)]; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + int arr[sizeof(this)]; // expected-error {{invalid use of 'this' outside of a non-static member function}} int sz = sizeof(this); // ok }; diff --git a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp index 9da9fcea1f8..4a2a4f3d735 100644 --- a/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp +++ b/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp @@ -27,7 +27,7 @@ struct ReachingThis { static void static_bar() { (void)[this](){}; // expected-error{{'this' cannot be captured in this context}} - (void)[&](){i = 7; }; // expected-error{{invalid use of nonstatic data member 'i'}} + (void)[&](){i = 7; }; // expected-error{{invalid use of member 'i' in static member function}} } }; } diff --git a/clang/test/CXX/special/class.free/p1.cpp b/clang/test/CXX/special/class.free/p1.cpp index e4fe127f9f5..5c0240b5dad 100644 --- a/clang/test/CXX/special/class.free/p1.cpp +++ b/clang/test/CXX/special/class.free/p1.cpp @@ -3,9 +3,9 @@ struct A { void *operator new(size_t) { - return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + return this; // expected-error {{invalid use of 'this' outside of a non-static member function}} } void *operator new[](size_t) { - return this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + return this; // expected-error {{invalid use of 'this' outside of a non-static member function}} } }; diff --git a/clang/test/CXX/special/class.free/p6.cpp b/clang/test/CXX/special/class.free/p6.cpp index 555d4e9cfa9..fc4b2ae1acf 100644 --- a/clang/test/CXX/special/class.free/p6.cpp +++ b/clang/test/CXX/special/class.free/p6.cpp @@ -3,9 +3,9 @@ struct A { void operator delete(void*) { - (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + (void)this; // expected-error {{invalid use of 'this' outside of a non-static member function}} } void operator delete[](void*) { - (void)this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + (void)this; // expected-error {{invalid use of 'this' outside of a non-static member function}} } }; diff --git a/clang/test/Parser/cxx-typeof.cpp b/clang/test/Parser/cxx-typeof.cpp index 4c598e9517e..1ec6e29b131 100644 --- a/clang/test/Parser/cxx-typeof.cpp +++ b/clang/test/Parser/cxx-typeof.cpp @@ -9,5 +9,5 @@ static void test() { // Part of rdar://problem/8347416; from the gcc test suite. struct S { int i; - __typeof(S::i) foo(); // expected-error {{invalid use of nonstatic data member 'i'}} + __typeof(S::i) foo(); // expected-error {{invalid use of non-static data member 'i'}} }; diff --git a/clang/test/SemaCXX/class.cpp b/clang/test/SemaCXX/class.cpp index e079d0cc175..ec82925fe4e 100644 --- a/clang/test/SemaCXX/class.cpp +++ b/clang/test/SemaCXX/class.cpp @@ -7,16 +7,18 @@ public: static void sm() { sx = 0; - this->x = 0; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + this->x = 0; // expected-error {{invalid use of 'this' outside of a non-static member function}} x = 0; // expected-error {{invalid use of member 'x' in static member function}} } class NestedC { public: NestedC(int); - void m() { + void f() { sx = 0; - x = 0; // expected-error {{invalid use of nonstatic data member 'x'}} + x = 0; // expected-error {{use of non-static data member 'x' of 'C' from nested type 'NestedC'}} + sm(); + m(); // expected-error {{call to non-static member function 'm' of 'C' from nested type 'NestedC'}} } }; @@ -186,7 +188,7 @@ struct S { }; void f() { - S::c; // expected-error {{invalid use of nonstatic data member}} + S::c; // expected-error {{invalid use of non-static data member}} } } diff --git a/clang/test/SemaCXX/default2.cpp b/clang/test/SemaCXX/default2.cpp index 20763229cfd..16260449d4b 100644 --- a/clang/test/SemaCXX/default2.cpp +++ b/clang/test/SemaCXX/default2.cpp @@ -28,7 +28,7 @@ void g(int x, int y = x); // expected-error {{default argument references parame void g2(int x, int y, int z = x + y); // expected-error {{default argument references parameter 'x'}} expected-error {{default argument references parameter 'y'}} class X { - void f(X* x = this); // expected-error{{invalid use of 'this' outside of a nonstatic member function}} + void f(X* x = this); // expected-error{{invalid use of 'this' outside of a non-static member function}} void g() { int f(X* x = this); // expected-error{{default argument references 'this'}} @@ -55,7 +55,7 @@ void C::h() { // C++ [dcl.fct.default]p9 struct Y { int a; - int mem1(int i = a); // expected-error{{invalid use of nonstatic data member 'a'}} + int mem1(int i = a); // expected-error{{invalid use of non-static data member 'a'}} int mem2(int i = b); // OK; use Y::b int mem3(int i); int mem4(int i); @@ -64,8 +64,8 @@ struct Y { int mem5(int i = b, // OK; use Y::b int j = c, // OK; use Y::Nested::c int k = j, // expected-error{{default argument references parameter 'j'}} - int l = a, // expected-error{{invalid use of nonstatic data member 'a'}} - Nested* self = this, // expected-error{{invalid use of 'this' outside of a nonstatic member function}} + int l = a, // expected-error{{invalid use of non-static data member 'a'}} + Nested* self = this, // expected-error{{invalid use of 'this' outside of a non-static member function}} int m); // expected-error{{missing default argument on parameter 'm'}} static int c; Nested(int i = 42); @@ -78,7 +78,7 @@ struct Y { int Y::mem3(int i = b) { return i; } // OK; use X::b -int Y::mem4(int i = a) // expected-error{{invalid use of nonstatic data member 'a'}} +int Y::mem4(int i = a) // expected-error{{invalid use of non-static data member 'a'}} { return i; } diff --git a/clang/test/SemaCXX/qual-id-test.cpp b/clang/test/SemaCXX/qual-id-test.cpp index e5c73067756..e43e6887c47 100644 --- a/clang/test/SemaCXX/qual-id-test.cpp +++ b/clang/test/SemaCXX/qual-id-test.cpp @@ -137,7 +137,7 @@ struct a { a a; -int a::sa = a.a; // expected-error {{invalid use of nonstatic data member 'a'}} +int a::sa = a.a; // expected-error {{invalid use of non-static data member 'a'}} namespace PR6645 { diff --git a/clang/test/SemaCXX/this.cpp b/clang/test/SemaCXX/this.cpp index 13158b93a44..27ee1e84a70 100644 --- a/clang/test/SemaCXX/this.cpp +++ b/clang/test/SemaCXX/this.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -fsyntax-only -verify %s -int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} +int x = this; // expected-error {{invalid use of 'this' outside of a non-static member function}} void f() { - int x = this; // expected-error {{invalid use of 'this' outside of a nonstatic member function}} + int x = this; // expected-error {{invalid use of 'this' outside of a non-static member function}} } |