Author: Matheus Izvekov
Date: 2024-05-20T22:49:53-03:00
New Revision: 4cebe5a43ba83eab477358ef4da665b43463bb68

URL: 
https://github.com/llvm/llvm-project/commit/4cebe5a43ba83eab477358ef4da665b43463bb68
DIFF: 
https://github.com/llvm/llvm-project/commit/4cebe5a43ba83eab477358ef4da665b43463bb68.diff

LOG: [clang] NFC: add test for cwg2398 ambiguity issue

Added: 
    

Modified: 
    clang/test/SemaTemplate/cwg2398.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaTemplate/cwg2398.cpp 
b/clang/test/SemaTemplate/cwg2398.cpp
index 31686c4bc9805..e3b5e575374d3 100644
--- a/clang/test/SemaTemplate/cwg2398.cpp
+++ b/clang/test/SemaTemplate/cwg2398.cpp
@@ -59,6 +59,21 @@ namespace templ {
   template struct C<B<int>>;
 } // namespace templ
 
+namespace class_template {
+  template <class T1, class T2 = float> struct A;
+
+  template <class T3> struct B;
+
+  template <template <class T4> class TT1, class T5> struct B<TT1<T5>>;
+  // new-note@-1 {{partial specialization matches}}
+
+  template <class T6, class T7> struct B<A<T6, T7>> {};
+  // new-note@-1 {{partial specialization matches}}
+
+  template struct B<A<int>>;
+  // new-error@-1 {{ambiguous partial specialization}}
+} // namespace class_template
+
 namespace type_pack1 {
   template<class T2> struct A;
   template<template<class ...T3s> class TT1, class T4> struct A<TT1<T4>>   ;


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to