summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTDiagnostic.cpp
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2014-12-20 02:42:08 +0000
committerRichard Trieu <rtrieu@google.com>2014-12-20 02:42:08 +0000
commitd787e8dc9d74011f4d2fa70e5941aad3eeec0f53 (patch)
treea2da0cac72a43f442ba04ec94c645c9946b23401 /clang/lib/AST/ASTDiagnostic.cpp
parent113dc64c67b4c56ab0a32835d148600c5fb544e0 (diff)
Fix for PR21758
When a non-type template argument expression needs a conversion to change it into the argument type, preserve that information by remaking the TemplateArgument with an expression that has those conversions. Also a small fix to template type diffing to handle the extra conversions in some cases. llvm-svn: 224667
Diffstat (limited to 'clang/lib/AST/ASTDiagnostic.cpp')
-rw-r--r--clang/lib/AST/ASTDiagnostic.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 3212359db183..ed823f5537a8 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -1655,11 +1655,14 @@ class TemplateDiff {
}
Unbold();
}
-
+
/// HasExtraInfo - Returns true if E is not an integer literal or the
/// negation of an integer literal
bool HasExtraInfo(Expr *E) {
if (!E) return false;
+
+ E = E->IgnoreImpCasts();
+
if (isa<IntegerLiteral>(E)) return false;
if (UnaryOperator *UO = dyn_cast<UnaryOperator>(E))