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

Matheus Izvekov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 19 11:15:35 PST 2025


================
@@ -1018,9 +1019,9 @@ namespace cwg62 { // cwg62: 2.9
   struct A {
     struct { int n; } b;
   };
-  template<typename T> struct X {};
-  template<typename T> T get() { return get<T>(); }
-  template<typename T> int take(T) { return 0; }
+  template<typename T> struct X {}; // cxx98-note 6{{template parameter is declared here}}
----------------
mizvekov wrote:

I support the bookmarks, they are fine, sure let's use them more.

My concern is not about the bookmarks though, is about the way the tests are written here, checking the whole
diagnostic sequence, but without actually checking it, and without any kind of automated update.

I would be strongly against adopting this for the other tests, as if this were a thing a while ago, this would have made many of my PRs unviable due to the amount of manual test rework required.

That is not to say that I don't agree with the overall goal, I think we do need to test for duplicated notes and things like that, but we should implement this in tooling, being actually verified and not manually updated.

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


More information about the llvm-branch-commits mailing list