[clang] [clang] disallow narrowing when matching template template parameters (PR #124313)

via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 25 00:37:10 PST 2025


================
@@ -66,8 +66,9 @@ namespace DependentType {
   using ok = Pt<tT0<int, i>, tT0<int, iDi>>;
   using err1 = tT0<int, ii>; // expected-error {{too few template arguments for class template 'ii'}}
                              // expected-note at -1 {{different template parameters}}
-  using err2 = tT0<short, i>; // FIXME: should this be OK?
-  using err2a = tT0<long long, i>; // FIXME: should this be OK (if long long is larger than int)?
+  using err2 = tT0<short, i>;
+  using err2a = tT0<long long, i>; // expected-error@#tT0 {{cannot be narrowed from type 'long long' to 'int'}}
+                                   // expected-note at -1 {{different template parameters}}
----------------
cor3ntin wrote:

Do we have any tests for floating points and enumeration types?

https://github.com/llvm/llvm-project/pull/124313


More information about the cfe-commits mailing list