summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-21 21:27:38 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-21 21:27:38 +0000
commit3985791d62e217b94ec8ded0084b3d8145febfb3 (patch)
treee324b7519d13444a5de56f70ea79adaecd94acdd /clang
parentdbf7074296ada13aacc5008ccf5ed1ab0fb25323 (diff)
downloadbcm5719-llvm-3985791d62e217b94ec8ded0084b3d8145febfb3.tar.gz
bcm5719-llvm-3985791d62e217b94ec8ded0084b3d8145febfb3.zip
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. llvm-svn: 91844
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaTemplateDeduction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateDeduction.cpp b/clang/lib/Sema/SemaTemplateDeduction.cpp
index b4754db7d6b..5434beaef12 100644
--- a/clang/lib/Sema/SemaTemplateDeduction.cpp
+++ b/clang/lib/Sema/SemaTemplateDeduction.cpp
@@ -476,7 +476,7 @@ DeduceTemplateArguments(ASTContext &Context,
}
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)
OpenPOWER on IntegriCloud