summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2013-07-20 03:49:02 +0000
committerRichard Trieu <rtrieu@google.com>2013-07-20 03:49:02 +0000
commit8ed6f2aacfe83bb823de2eb7975e704b89d1264b (patch)
tree3748b85516de6c1884cbfab5de85d3ad6d6649a3 /clang/lib
parent08905dd60becc00d1fc65b3048f80891948de66e (diff)
downloadbcm5719-llvm-8ed6f2aacfe83bb823de2eb7975e704b89d1264b.tar.gz
bcm5719-llvm-8ed6f2aacfe83bb823de2eb7975e704b89d1264b.zip
If a default argument is a dependent type, get the real type from the desugared
template. Passing around dependent types can lead to integral arguments that cannot be evaluated. llvm-svn: 186757
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTDiagnostic.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index bc707ddbc1e..eb22632c937 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -1054,10 +1054,14 @@ class TemplateDiff {
if (!Iter.isEnd())
return Iter->getAsType();
- if (!isVariadic)
- return DefaultTTPD->getDefaultArgument();
+ if (isVariadic)
+ return QualType();
+
+ QualType ArgType = DefaultTTPD->getDefaultArgument();
+ if (ArgType->isDependentType())
+ return Iter.getDesugar().getAsType();
- return QualType();
+ return ArgType;
}
/// GetExpr - Retrieves the template expression argument, including default
OpenPOWER on IntegriCloud