diff options
author | Anders Carlsson <andersca@mac.com> | 2009-09-05 22:51:06 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-09-05 22:51:06 +0000 |
commit | 657bff7ff399d08812a3b3324dbbebf68b0df07d (patch) | |
tree | b3bdc469e9b8a704df2a5d4c4473ed9b8d9dcfb6 /test/SemaTemplate/default-expr-arguments.cpp | |
parent | 0667db34ee3a9e2841313109123accf7e3e98063 (diff) |
Initialize default CXXConstructExpr arguments to 0. Fixes a crash when destroying the CXXConstructExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81096 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r-- | test/SemaTemplate/default-expr-arguments.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 925d52fb19..d689cc86e6 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -20,7 +20,7 @@ void g() { } template<typename T> struct F { - F(T t = 10); + F(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}} void f(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}} }; @@ -34,6 +34,9 @@ void g2() { void g3(F<int> f, F<struct S> s) { f.f(); s.f(); // expected-note{{in instantiation of default function argument expression for 'f<struct S>' required here}} + + F<int> f2; + F<S> s2; // expected-note{{in instantiation of default function argument expression for 'F<struct S>' required here}} } template<typename T> struct G { |