[PATCH] D30766: Add support for attribute "enum_extensibility"

Akira Hatanaka via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 14 15:17:08 PDT 2017


ahatanak added inline comments.


================
Comment at: test/Sema/enum-attr.c:27
+
+enum __attribute__((enum_extensibility(arg1))) EnumInvalidArg { // expected-warning{{'enum_extensibility' attribute argument not supported: 'arg1'}}
+  G
----------------
aaron.ballman wrote:
> ahatanak wrote:
> > arphaman wrote:
> > > Should this be an error instead?
> > Yes, I agree.
> I'm not opposed to it, but we do treat it as a warning for every other attribute (and just ignore the attribute), FWIW.
Do you know the reason we treat wrong attribute arguments as a warning in other cases rather than an error?

I'm guessing a warning is preferred because in most cases dropping an attribute doesn't affect correctness (it doesn't cause miscompiles).


https://reviews.llvm.org/D30766





More information about the cfe-commits mailing list