[clang] [clang] Add support for [[clang::diagnose_if(...)]] and [[clang::enable_if(...)]] syntax (PR #225900)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 24 19:28:05 PDT 2026


================
@@ -1938,7 +1902,7 @@ def EnableIf : InheritableAttr {
   // Does not have a [[]] spelling because this attribute requires the ability
   // to parse function arguments but the attribute is not written in the type
   // position.
-  let Spellings = [GNU<"enable_if">];
+  let Spellings = [Clang<"enable_if">];
----------------
higher-performance wrote:

Hmm I see. Before I give up, could I get your thoughts on [my last question](https://github.com/llvm/llvm-project/pull/225900#issuecomment-5804354535)? Like what concrete problem could arise if we allowed this to work in the type position, but operate on the declaration? Could the standard conceivably mandate that it actually modify the type somehow? That seems pretty much impossible to me for something whose meaning the standard doesn't dictate, so what else could go wrong?

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


More information about the cfe-commits mailing list