diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-12-19 03:01:41 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-12-19 03:01:41 +0000 |
commit | 7abfbdbc97ad8e7f340789f751df1e32b10118b4 (patch) | |
tree | c98c3dd47e10bceea032ec5fb2b44306f109dacd /test/SemaTemplate/default-expr-arguments.cpp | |
parent | 29f1a6070ac35fcbea9241c843df7f3f7c5c3228 (diff) |
Switch more of Sema::CheckInitializerTypes over to
InitializationSequence. Specially, switch initialization of a C++
class type (either copy- or direct-initialization).
Also, make sure that we create an elidable copy-construction when
performing copy initialization of a C++ class variable. Fixes PR5826.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/default-expr-arguments.cpp')
-rw-r--r-- | test/SemaTemplate/default-expr-arguments.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 4c2f5465dc..df3cc96ba2 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -6,9 +6,9 @@ class C { C(int a0 = 0); }; template<> C<char>::C(int a0); -struct S { }; +struct S { }; // expected-note 3 {{candidate function}} -template<typename T> void f1(T a, T b = 10) { } // expected-error{{cannot initialize 'b' with an rvalue of type 'int'}} +template<typename T> void f1(T a, T b = 10) { } // expected-error{{no viable conversion}} template<typename T> void f2(T a, T b = T()) { } @@ -26,8 +26,8 @@ void g() { } template<typename T> struct F { - 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'}} + F(T t = 10); // expected-error{{no viable conversion}} + void f(T t = 10); // expected-error{{no viable conversion}} }; struct FD : F<int> { }; |