summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-04-18 02:16:12 +0000
committerDouglas Gregor <dgregor@apple.com>2010-04-18 02:16:12 +0000
commit7566e4ad2cf1a03fccfe97a110ccf3f5e80f1988 (patch)
treeb314fd37d93965ba5a54088fcfaf78b44b4a5cb5 /clang/lib
parent268195e1d4b5bd651654505e51a204f07bfec7b6 (diff)
downloadbcm5719-llvm-7566e4ad2cf1a03fccfe97a110ccf3f5e80f1988.tar.gz
bcm5719-llvm-7566e4ad2cf1a03fccfe97a110ccf3f5e80f1988.zip
Do not consider explicit constructors when performing a copy to a
temporary object. This is blindingly obvious from reading C++ [over.match.ctor]p1, but somehow I'd missed it and it took DR152 to educate me. Adjust one test that was relying on this non-standard behavior. llvm-svn: 101688
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 4986fcbedf5..db7c1b396a2 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -3174,7 +3174,8 @@ static Sema::OwningExprResult CopyObject(Sema &S,
// Only consider copy constructors.
CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(*Con);
if (!Constructor || Constructor->isInvalidDecl() ||
- !Constructor->isCopyConstructor())
+ !Constructor->isCopyConstructor() ||
+ !Constructor->isConvertingConstructor(/*AllowExplicit=*/false))
continue;
DeclAccessPair FoundDecl
OpenPOWER on IntegriCloud