Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-17 Thread Mark Mitchell
Geoffrey Keating wrote: A typedef declaration which adds semantic attributes to a non-class type is valid, but again creates an entirely new type. >> It is invalid to do anything that would require either type_info or a mangled name for "Q", including using it as an argument to typeid, thowi

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-16 Thread Geoffrey Keating
Mark Mitchell <[EMAIL PROTECTED]> writes: > We have a number of C++ PRs open around problems with code like this: > >struct S { > void f(); > virtual void g(); >}; > >typedef __attribute__((...)) struct S T; > > If the attribute makes any substantive change to S (e.g., cha

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-16 Thread Jason Merrill
Joseph S. Myers wrote: I was referring to the change in extend.texi -the closing brace. It is ignored if the content of the structure, union -or enumerated type is not defined in the specifier in which the -attribute specifier list is used---that is, in usages such as [EMAIL PROTECTED] __attrib

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-16 Thread Mark Mitchell
Jason Merrill wrote: 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. OK, that certainly makes sense. (That's one of the ite

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-16 Thread Joseph S. Myers
On Mon, 16 Oct 2006, Jason Merrill wrote: > 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

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-16 Thread Jason Merrill
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 su

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-15 Thread Richard Kenner
> If the attribute makes any substantive change to S (e.g., changes its > size, alignment, etc.) then bad things happen. For example, the member > functions of "S" have expectations about the layout of "S" that are not > satisfied if they are called with a "T". Depending on the attribute and

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-15 Thread Chris Lattner
On Oct 15, 2006, at 3:12 PM, Mark Mitchell wrote: A typedef declaration which adds semantic attributes to a POD class type with no function members is valid, but creates an entirely new type, different from all other types except others formed by adding the same combination of semantic attr

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-15 Thread Mark Mitchell
Joseph S. Myers wrote: On Sun, 15 Oct 2006, Mark Mitchell wrote: We have a number of C++ PRs open around problems with code like this: struct S { void f(); virtual void g(); }; typedef __attribute__((...)) struct S T; I was happy with the state before r115086 (i.e. with it be

Re: Proposed semantics for attributes in C++ (and in C?)

2006-10-15 Thread Joseph S. Myers
On Sun, 15 Oct 2006, Mark Mitchell wrote: > We have a number of C++ PRs open around problems with code like this: > > struct S { > void f(); > virtual void g(); > }; > > typedef __attribute__((...)) struct S T; I was happy with the state before r115086 (i.e. with it being document

Proposed semantics for attributes in C++ (and in C?)

2006-10-15 Thread Mark Mitchell
We have a number of C++ PRs open around problems with code like this: struct S { void f(); virtual void g(); }; typedef __attribute__((...)) struct S T; If the attribute makes any substantive change to S (e.g., changes its size, alignment, etc.) then bad things happen. For examp