diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-11-12 03:34:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-11-12 03:34:06 +0000 |
commit | 8ff338bfd8abd9ac5d0c1d89c1b05e2c02727174 (patch) | |
tree | fb31fec40321d2a3b7a2f0366e97f47ee40178db /test/SemaCXX/copy-initialization.cpp | |
parent | 89414b384a0004c698244cc675f49d0669bb3463 (diff) |
When performing initialization of a copy of a temporary object, use
direct-initialization (rather than copy-initialization) to initialize
the temporary, allowing explicit constructors. Fixes PR8342.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/copy-initialization.cpp')
-rw-r--r-- | test/SemaCXX/copy-initialization.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SemaCXX/copy-initialization.cpp b/test/SemaCXX/copy-initialization.cpp index 641eaa9411..a28a1941ec 100644 --- a/test/SemaCXX/copy-initialization.cpp +++ b/test/SemaCXX/copy-initialization.cpp @@ -10,8 +10,8 @@ class Y : public X { }; void f(Y y, int *ip, float *fp) { X x1 = y; // expected-error{{no matching constructor for initialization of 'X'}} - X x2 = 0; // expected-error{{no viable constructor copying variable}} - X x3 = ip; // expected-error{{no viable constructor copying variable}} + X x2 = 0; + X x3 = ip; X x4 = fp; // expected-error{{no viable conversion}} X x2a(0); // expected-error{{call to constructor of 'X' is ambiguous}} X x3a(ip); |