[clang] [Clang] Add [[clang::diagnose_specializations]] (PR #101469)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 05:56:37 PDT 2024


philnik777 wrote:

> Also consider adding an argument that lets you diagnose https://eel.is/c++draft/namespace.std#2.1
> 
> > * the added declaration depends on at least one program-defined type,
> 
> To diagnose specializations for `std::pair<int, int>`, but allow `std::pair<MyClass, int>`.

Given that this seems like a very standard-library-specific feature I'm not sure it makes a ton of sense to add it to this attribute. I think adding an ad-hoc diagnostic for this would be better.

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


More information about the cfe-commits mailing list