[llvm-branch-commits] [cfe-branch] r214694 - Merging r213902:

Bill Wendling isanbard at gmail.com
Sun Aug 3 21:35:58 PDT 2014


Author: void
Date: Sun Aug  3 23:35:58 2014
New Revision: 214694

URL: http://llvm.org/viewvc/llvm-project?rev=214694&view=rev
Log:
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.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_35/   (props changed)
    cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp
    cfe/branches/release_35/test/Misc/diag-template-diffing.cpp

Propchange: cfe/branches/release_35/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Aug  3 23:35:58 2014
@@ -1,4 +1,4 @@
 /cfe/branches/type-system-rewrite:134693-134817
-/cfe/trunk:213609,213611,213613,213741,213840,213993,213998,214208
+/cfe/trunk:213609,213611,213613,213741,213840,213902,213993,213998,214208
 /cfe/trunk/test:170344
 /cfe/trunk/test/SemaTemplate:126920

Modified: cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp?rev=214694&r1=214693&r2=214694&view=diff
==============================================================================
--- cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp (original)
+++ cfe/branches/release_35/lib/AST/ASTDiagnostic.cpp Sun Aug  3 23:35:58 2014
@@ -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);
       }
 

Modified: cfe/branches/release_35/test/Misc/diag-template-diffing.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_35/test/Misc/diag-template-diffing.cpp?rev=214694&r1=214693&r2=214694&view=diff
==============================================================================
--- cfe/branches/release_35/test/Misc/diag-template-diffing.cpp (original)
+++ cfe/branches/release_35/test/Misc/diag-template-diffing.cpp Sun Aug  3 23:35:58 2014
@@ -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.





More information about the llvm-branch-commits mailing list