diff options
Diffstat (limited to 'test/SemaCXX/member-init.cpp')
-rw-r--r-- | test/SemaCXX/member-init.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/test/SemaCXX/member-init.cpp b/test/SemaCXX/member-init.cpp index 7ca1f0e4513e..819c8d13db89 100644 --- a/test/SemaCXX/member-init.cpp +++ b/test/SemaCXX/member-init.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -std=c++0x -Wall %s +// RUN: %clang_cc1 -fsyntax-only -fcxx-exceptions -verify -std=c++11 -Wall %s struct Bitfield { int n : 3 = 7; // expected-error {{bitfield member cannot have an in-class initializer}} @@ -52,3 +52,21 @@ struct CheckExcSpecFail { struct TypedefInit { typedef int A = 0; // expected-error {{illegal initializer}} }; + +// PR10578 / <rdar://problem/9877267> +namespace PR10578 { + template<typename T> + struct X { + X() { + T* x = 1; // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}} + } + }; + + struct Y : X<int> { + Y(); + }; + + Y::Y() try { // expected-note{{in instantiation of member function 'PR10578::X<int>::X' requested here}} + } catch(...) { + } +} |