From 7566e4ad2cf1a03fccfe97a110ccf3f5e80f1988 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sun, 18 Apr 2010 02:16:12 +0000 Subject: 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 --- clang/lib/Sema/SemaInit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema') 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(*Con); if (!Constructor || Constructor->isInvalidDecl() || - !Constructor->isCopyConstructor()) + !Constructor->isCopyConstructor() || + !Constructor->isConvertingConstructor(/*AllowExplicit=*/false)) continue; DeclAccessPair FoundDecl -- cgit v1.2.3