https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43407

--- Comment #3 from Brian Adams <badams at gnarlie dot com> ---
This bug is also in 4.9.0, and applies to /any/ attribute. Assuming a GCC
plugin that defines 'my_attr': 

   enum class __attribute__((my_attr)) MessageType : uint8_t  {}

will generate the warning

   Messages.h:37:1: warning: type attributes ignored after type is already
defined [-Wattributes]

As a work around, this code functions as desired:

   enum class MessageType : uint8_t  __attribute__((my_attr)) {}

Interestingly, putting the attribute *before* the enum keyword generates a
warning and note that are (currently) incorrect, given this bug:

   warning: attribute ignored in declaration of ‘enum class MessageType’
[-Wattributes]
    __attribute__((my_attr)) enum class MessageType : uint8_t  {
                                     ^
   note: attribute for ‘enum class batsoe::MessageType’ must follow the ‘enum
class’ keyword

Reply via email to