]> granicus.if.org Git - clang/commitdiff
A constructor template cannot be used to copy to an object of the same class type...
authorDouglas Gregor <dgregor@apple.com>
Sun, 21 Feb 2010 18:30:38 +0000 (18:30 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 21 Feb 2010 18:30:38 +0000 (18:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96742 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaOverload.cpp

index b79b1cc9937540558bd43520198c41fcd90b93ac..1c6fd17c381361a0b344aa7a4e1fc664d52c7bd9 100644 (file)
@@ -2439,7 +2439,8 @@ Sema::AddOverloadCandidate(FunctionDecl *Function,
     QualType ClassType = Context.getTypeDeclType(Constructor->getParent());
     if (NumArgs == 1 && 
         Constructor->isCopyConstructorLikeSpecialization() &&
-        Context.hasSameUnqualifiedType(ClassType, Args[0]->getType()))
+        (Context.hasSameUnqualifiedType(ClassType, Args[0]->getType()) ||
+         IsDerivedFrom(Args[0]->getType(), ClassType)))
       return;
   }