Proposed semantics for attributes in C++ (and in C?)
Jason Merrill
jason@redhat.com
Mon Oct 16 14:54:00 GMT 2006
Mark Mitchell wrote:
> Yes, I would be happy to explicitly ignore semantic attributes in
> typedefs as well, with a warning (or even an error). However, I had not
> realized that we ever did that; I'm surprised that the change that
> instituted this is so recent. I suppose that explains why we're
> suddenly seeing a rash of such problems. Jason, as you made this
> change, do you have any comments on the proposal?
I don't think my patch changed the handling of class typedefs; certainly
my intent was only to change how we handle
class __attribute ((foo)) C
Previously we rejected it, now we apply the attributes to the class.
Which PRs are you referring to?
I'd be inclined to prohibit semantic attributes on typedefs in general.
Extending the type system to handle attribute types seems excessively
complicated. I think we should define a set of attributes which prevent
us from taking the address of a variable with that attribute
(packed...anything else?) and check for them at the same places we check
for taking the address of a bitfield.
Jason
More information about the Gcc
mailing list