[clang] [clang] Implement instantiation context note for checking template parameters (PR #126088)

via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 25 23:55:12 PST 2025


================
@@ -5294,10 +5294,14 @@ def err_template_missing_args : Error<
   "%select{class template|function template|variable template|alias template|"
   "template template parameter|concept|template}0 %1 requires template "
   "arguments">;
-def err_template_arg_list_different_arity : Error<
-  "%select{too few|too many}0 template arguments for "
+def err_template_param_missing_arg : Error<
+  "missing template argument for template parameter">;
+def err_template_template_param_missing_param : Error<
+  "missing template parameter to bind to template template parameter">;
----------------
h-vetinari wrote:

>From the peanut gallery: as someone who stares at error messages from building 100s of projects in a distribution a lot, I'd find it a lot more intuitive if the error message started with
```
test.cc:3:19: error: <something here>
    3 | template struct B<A>;
      |                   ^
test.cc:3:<line>: note: <elaboration>
```
where ideally the elaboration goes like "template `A` from \<here> doesn't satisfy template template for `B` from \<there>".

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


More information about the cfe-commits mailing list