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 | cbd0710a1276faee78ac6e9f8e2108a2cb8103ee (patch) | |
tree | 9d3a6355fa6e0a075c3a2ba685146c8563a7c94d /clang/test/SemaCXX/copy-initialization.cpp | |
parent | 8c9e5383846304ad9bd47515293fe6b2dc76d825 (diff) | |
download | bcm5719-llvm-cbd0710a1276faee78ac6e9f8e2108a2cb8103ee.tar.gz bcm5719-llvm-cbd0710a1276faee78ac6e9f8e2108a2cb8103ee.zip |
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.
llvm-svn: 118880
Diffstat (limited to 'clang/test/SemaCXX/copy-initialization.cpp')
-rw-r--r-- | clang/test/SemaCXX/copy-initialization.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/copy-initialization.cpp b/clang/test/SemaCXX/copy-initialization.cpp index 641eaa9411f..a28a1941ece 100644 --- a/clang/test/SemaCXX/copy-initialization.cpp +++ b/clang/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); |