================
@@ -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">];
----------------
AaronBallman wrote:

The comment is not wrong; we intentionally do not support it with the `[[]]` 
spelling because more often than not the parameters are used for the 
`diagnose_if` or `enable_if` condition and that means the attribute has to be 
after the parameter list. However, with `[[]]` attributes, where you put the 
attribute list determines what it appertains to and trailing after the 
parameter list makes it a type attribute which would impact the function type. 
However, these have always been declaration attributes, not type attributes 
(and we do not want to break the standard model for appertainment). That's why 
we only support the `__attribute__` spelling for these -- that has no strict 
appertainment rules and can slide the attribute around to whatever makes sense.

So while you're right that *some* uses can be in declaration form because they 
don't mention parameter names, most uses cannot and we don't want to support 
the `[[]]` spelling until we have a solution for that.

https://github.com/llvm/llvm-project/pull/225900
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to