aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/member-init.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/member-init.cpp')
-rw-r--r--test/SemaCXX/member-init.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaCXX/member-init.cpp b/test/SemaCXX/member-init.cpp
index 7ca1f0e451..192851460c 100644
--- a/test/SemaCXX/member-init.cpp
+++ b/test/SemaCXX/member-init.cpp
@@ -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(...) {
+ }
+}