diff options
author | Richard Trieu <rtrieu@google.com> | 2014-12-20 02:42:08 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2014-12-20 02:42:08 +0000 |
commit | d787e8dc9d74011f4d2fa70e5941aad3eeec0f53 (patch) | |
tree | a2da0cac72a43f442ba04ec94c645c9946b23401 /clang/lib/AST/ASTDiagnostic.cpp | |
parent | 113dc64c67b4c56ab0a32835d148600c5fb544e0 (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.cpp | 5 |
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)) |