diff options
Diffstat (limited to 'test/CXX/class')
-rw-r--r-- | test/CXX/class/class.friend/p2.cpp | 4 | ||||
-rw-r--r-- | test/CXX/class/class.mem/p1b.cpp | 2 | ||||
-rw-r--r-- | test/CXX/class/class.mem/p5-0x.cpp | 9 |
3 files changed, 12 insertions, 3 deletions
diff --git a/test/CXX/class/class.friend/p2.cpp b/test/CXX/class/class.friend/p2.cpp index eb5036f..87b69c0 100644 --- a/test/CXX/class/class.friend/p2.cpp +++ b/test/CXX/class/class.friend/p2.cpp @@ -4,7 +4,7 @@ struct B0; class A { friend class B {}; // expected-error {{cannot define a type in a friend declaration}} - friend int; // expected-warning {{non-class type 'int' cannot be a friend}} - friend B0; // expected-warning {{must specify 'struct' to befriend}} + friend int; // expected-warning {{non-class friend type 'int' is a C++0x extension}} + friend B0; // expected-warning {{specify 'struct' to befriend 'B0'}} friend class C; // okay }; diff --git a/test/CXX/class/class.mem/p1b.cpp b/test/CXX/class/class.mem/p1b.cpp index d3493f6..3e8c985 100644 --- a/test/CXX/class/class.mem/p1b.cpp +++ b/test/CXX/class/class.mem/p1b.cpp @@ -16,7 +16,7 @@ public: void a3(int a = 42); - // CHEKC: error: use of undeclared identifier 'first' + // CHECK: error: use of undeclared identifier 'first' void a4(int a = first); // expected-error{{use of undeclared identifier 'first'}} class B { diff --git a/test/CXX/class/class.mem/p5-0x.cpp b/test/CXX/class/class.mem/p5-0x.cpp new file mode 100644 index 0000000..78560e2 --- /dev/null +++ b/test/CXX/class/class.mem/p5-0x.cpp @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s + +int f(); + +struct S +{ + int a = f(); // ok + int b = g(); // expected-error {{use of undeclared identifier 'g'}} +}; |