aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
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
commit153b3ba7a61f3228fd3a8c67b9bff94db3e13a2e (patch)
tree48000be38919033eead69b79bc474c70b82aa978 /lib/Sema/SemaInit.cpp
parent6ba38151f7e31d7f9194c8bbb91229cb5ffbb6f4 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 4986fcbedf..db7c1b396a 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/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