================ @@ -47,3 +47,21 @@ namespace InvalidInsertPos { template<> int v<int, 0>; int k = v<int, 500>; } + +namespace GH51347 { + template <typename T> + auto p = p<T>; // expected-error {{the type of variable template specialization 'p<int>'}} ---------------- erichkeane wrote:
It should be the same/similar as when we recognize the `auto x= x +1 ` or `int x = x + 1;` (one is an error, the other is a warning). This is probably fine if this isn't a primary template, right? Generally, Clang templates try to diagnose things as absolute early as possible so we get ONE error instead of one-per-instantiation. That said, it is perhaps worth spending some time to see if there is a reason we can't, or, by language rule, shouldn't diagnose this on `auto p = p <T>;` https://github.com/llvm/llvm-project/pull/134522 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits