[cfe-commits] r91844 - /cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp

Douglas Gregor dgregor at apple.com
Mon Dec 21 13:27:39 PST 2009


Author: dgregor
Date: Mon Dec 21 15:27:38 2009
New Revision: 91844

URL: http://llvm.org/viewvc/llvm-project?rev=91844&view=rev
Log:
Introduce an assertion to ensure that template argument deduction does
not deduce an "overload" type. Such a deduction indicates a failure in
semantic analysis  (e.g., PR5811) that currently isn't caught until
code-generation time. This assertions makes it clearer that this
particular issue is a semantic-analysis problem, not a code-gen problem.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp?rev=91844&r1=91843&r2=91844&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateDeduction.cpp Mon Dec 21 15:27:38 2009
@@ -476,7 +476,7 @@
     }
 
     assert(TemplateTypeParm->getDepth() == 0 && "Can't deduce with depth > 0");
-
+    assert(Arg != Context.OverloadTy && "Unresolved overloaded function");
     QualType DeducedType = Arg;
     DeducedType.removeCVRQualifiers(Param.getCVRQualifiers());
     if (RecanonicalizeArg)





More information about the cfe-commits mailing list