aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/default-expr-arguments.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r--test/SemaTemplate/default-expr-arguments.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp
index eff59a84e3..8d54926b96 100644
--- a/test/SemaTemplate/default-expr-arguments.cpp
+++ b/test/SemaTemplate/default-expr-arguments.cpp
@@ -274,3 +274,21 @@ namespace rdar8427926 {
x->g();
}
}
+
+namespace PR8401 {
+ template<typename T>
+ struct A {
+ A() { T* x = 1; } // expected-error{{cannot initialize a variable of type 'int *' with an rvalue of type 'int'}}
+ };
+
+ template<typename T>
+ struct B {
+ B(const A<T>& a = A<T>()); // expected-note{{in instantiation of}}
+ };
+
+ void f(B<int> b = B<int>());
+
+ void g() {
+ f();
+ }
+}