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

Mital Ashok via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 1 05:39:13 PDT 2024


================
@@ -975,6 +975,15 @@ Query for this feature with ``__has_attribute(diagnose_if)``.
   }];
 }
 
+def DiagnoseSpecializationsDocs : Documentation {
+  let Category = DocCatDecl;
+  let Content = [{
+``clang::diagnose_specializations`` can be appied to class templates which
+should not be specialized by users. This is primarily used to diagnose user
+specializations of standard library type traits.
----------------
MitalAshok wrote:

"applied to class or variable templates which should not be specialized."

I think "by users" should either be omitted or replaced with "by others"/"elsewhere" here, since this could be used by non-standard-library writers too. It's fine in the next sentence though.


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


More information about the cfe-commits mailing list