summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2014-08-04 04:35:58 +0000
committerBill Wendling <isanbard@gmail.com>2014-08-04 04:35:58 +0000
commitfc7217adf605945ae3182214f704dad1d269dae7 (patch)
treefd9ff7b33866fac2858295bb432ff6589f4f1b95
parent3e91ed59516f8ccd6478346be9319baf8a843c17 (diff)
Merging r213902:
------------------------------------------------------------------------ r213902 | rtrieu | 2014-07-24 16:14:16 -0700 (Thu, 24 Jul 2014) | 3 lines Print "(default)" for default template template arguments to match the printing of other types. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_35@214694 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ASTDiagnostic.cpp1
-rw-r--r--test/Misc/diag-template-diffing.cpp23
2 files changed, 23 insertions, 1 deletions
diff --git a/lib/AST/ASTDiagnostic.cpp b/lib/AST/ASTDiagnostic.cpp
index 5e6acf8e97..93b41a1335 100644
--- a/lib/AST/ASTDiagnostic.cpp
+++ b/lib/AST/ASTDiagnostic.cpp
@@ -1076,6 +1076,7 @@ class TemplateDiff {
Tree.SetSame(
FromDecl && ToDecl &&
FromDecl->getCanonicalDecl() == ToDecl->getCanonicalDecl());
+ Tree.SetDefault(FromIter.isEnd() && FromDecl, ToIter.isEnd() && ToDecl);
Tree.SetKind(DiffTree::TemplateTemplate);
}
diff --git a/test/Misc/diag-template-diffing.cpp b/test/Misc/diag-template-diffing.cpp
index 55ffb19c33..e21dc9fb9e 100644
--- a/test/Misc/diag-template-diffing.cpp
+++ b/test/Misc/diag-template-diffing.cpp
@@ -1178,11 +1178,32 @@ Wrapper<S<&global2, nullptr>> W12 =
// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<&global, [...]>>' to 'Wrapper<S<&global2, [...]>>'
Wrapper<S<&global, &global>> W13 = MakeWrapper<S<&global, ptr>>();
-// C HECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], nullptr>>' to 'Wrapper<S<[...], &global>>'
+// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], nullptr>>' to 'Wrapper<S<[...], &global>>'
Wrapper<S<&global, ptr>> W14 = MakeWrapper<S<&global, &global>>();
// CHECK-ELIDE-NOTREE: no viable conversion from 'Wrapper<S<[...], &global>>' to 'Wrapper<S<[...], ptr>>'
}
+namespace TemplateTemplateDefault {
+template <class> class A{};
+template <class> class B{};
+template <class> class C{};
+template <template <class> class, template <class> class = A>
+ class T {};
+
+T<A> t1 = T<A, C>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<[...], template C>' to 'T<[...], (default) template A>'
+T<A, C> t2 = T<A>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<[...], (default) template A>' to 'T<[...], template C>'
+T<A> t3 = T<B>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<template B>' to 'T<template A>'
+T<B, C> t4 = T<C, B>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<template C, template B>' to 'T<template B, template C>'
+T<A, A> t5 = T<B>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<template B, [...]>' to 'T<template A, [...]>'
+T<B> t6 = T<A, A>();
+// CHECK-ELIDE-NOTREE: no viable conversion from 'T<template A, [...]>' to 'T<template B, [...]>'
+}
+
// CHECK-ELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-NOELIDE-NOTREE: {{[0-9]*}} errors generated.
// CHECK-ELIDE-TREE: {{[0-9]*}} errors generated.