summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2016-02-02 00:36:59 +0000
committerRichard Trieu <rtrieu@google.com>2016-02-02 00:36:59 +0000
commit12074509d707d99c767e0d987cfd14c9cdf1963f (patch)
treec3b4573949f073c8365bf61d8f72e760752e9de0 /clang/lib
parentcdb7882cb28288fed0b6956fc07db698f4f53ec8 (diff)
downloadbcm5719-llvm-12074509d707d99c767e0d987cfd14c9cdf1963f.tar.gz
bcm5719-llvm-12074509d707d99c767e0d987cfd14c9cdf1963f.zip
Template Type Diffing change
When all the arguments of a template are elided, print "A<...>" instead of "A<[2 * ...]>". Also remove comment fragment that means nothing. llvm-svn: 259445
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTDiagnostic.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTDiagnostic.cpp b/clang/lib/AST/ASTDiagnostic.cpp
index 2ab5a32917a..62fbfddc459 100644
--- a/clang/lib/AST/ASTDiagnostic.cpp
+++ b/clang/lib/AST/ASTDiagnostic.cpp
@@ -497,7 +497,7 @@ class TemplateDiff {
enum DiffKind {
/// Incomplete or invalid node.
Invalid,
- /// Another level of templates, requires that
+ /// Another level of templates
Template,
/// Type difference, all type differences except those falling under
/// the Template difference.
@@ -1523,12 +1523,14 @@ class TemplateDiff {
OS << FromTD->getNameAsString() << '<';
Tree.MoveToChild();
unsigned NumElideArgs = 0;
+ bool AllArgsElided = true;
do {
if (ElideType) {
if (Tree.NodeIsSame()) {
++NumElideArgs;
continue;
}
+ AllArgsElided = false;
if (NumElideArgs > 0) {
PrintElideArgs(NumElideArgs, Indent);
NumElideArgs = 0;
@@ -1539,8 +1541,12 @@ class TemplateDiff {
if (Tree.HasNextSibling())
OS << ", ";
} while (Tree.AdvanceSibling());
- if (NumElideArgs > 0)
- PrintElideArgs(NumElideArgs, Indent);
+ if (NumElideArgs > 0) {
+ if (AllArgsElided)
+ OS << "...";
+ else
+ PrintElideArgs(NumElideArgs, Indent);
+ }
Tree.Parent();
OS << ">";
OpenPOWER on IntegriCloud