This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [C PATCH] Make attributes accept enum values (PR c/50459)


On 04/15/2014 03:56 PM, Marek Polacek wrote:
The testsuite doesn't hit this code with C++, but does hit this code
with C.  The thing is, if we have e.g.
enum { A = 128 };
void *fn1 (void) __attribute__((assume_aligned (A)));
then handle_assume_aligned_attribute walks the attribute arguments
and gets the argument via TREE_VALUE.  If this argument is an enum
value, then for C the argument is identifier_node that contains const_decl,

Ah. Then I think the C parser should be fixed to check attribute_takes_identifier_p and look up the argument if false.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]