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

Vlad Serebrennikov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Feb 19 11:04:24 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}}
----------------
Endilll wrote:

> There was no discussion about these points I raised on that PR, was there any other discussions in other mediums, like Discourse?

No.

> I think the more important question is, do we need this amount of detail for the diagnostic messages of DR tests specifically, what makes them more special than the other tests in this case?

It happened with DR tests, because I've been spending a significant chunk of my time in `clang/test/CXX/drs`, so I had a holistic view on everything in there, and was willing to improve the status quo. If we as a community think that this approach to `-verify` tests is good, it can be applied elsewhere too, but that's an RFC material, I guess. I remember @erichkeane being sad that so little tests use bookmarks, precisely for readability reasons for reviewers, so I think there is support to write expected directives in a similar way outside of DR tests.

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


More information about the llvm-branch-commits mailing list