[Bug c++/43859] transparent_union mishandled

2016-01-21 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43859

Jason Merrill  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 CC||jason at gcc dot gnu.org
 Resolution|--- |FIXED
   Target Milestone|--- |4.7.4

--- Comment #6 from Jason Merrill  ---
The testcase passes in 4.7 and up.

[Bug c++/43859] transparent_union mishandled

2010-04-23 Thread bergner at gcc dot gnu dot org


--- Comment #5 from bergner at gcc dot gnu dot org  2010-04-23 16:24 ---
Sorry, I meant type attribute where I mentioned variable attribute.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43859



[Bug c++/43859] transparent_union mishandled

2010-04-23 Thread bergner at gcc dot gnu dot org


--- Comment #4 from bergner at gcc dot gnu dot org  2010-04-23 16:15 ---
Interesting, using:

  union __attribute__ ((transparent_union)) q
  {
unsigned n;
unsigned get_n () const { return n; }
  };

does seem to cure it.  However, is the attribute location really incorrect?  It
seems the gcc docs on variable attributes have several examples where an
attribute is located at the end of the declaration.  And the attribute syntax
documention has this tidbit:

An attribute specifier list may appear as part of a struct, union or enum
specifier. It may go either immediately after the struct, union or enum
keyword, or after the closing brace. The former syntax is preferred. Where
attribute specifiers follow the closing brace, they are considered to relate to
the structure, union or enumerated type defined, not to any enclosing
declaration the type specifier appears in, and the type defined is not complete
until after the attribute specifiers. 

So it looks to me like it should work where I have it, doesn't it?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43859



[Bug c++/43859] transparent_union mishandled

2010-04-22 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2010-04-22 22:48 ---
I think you have the attribute in the wrong location.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43859



[Bug c++/43859] transparent_union mishandled

2010-04-22 Thread pinskia at gcc dot gnu dot org


--- Comment #2 from pinskia at gcc dot gnu dot org  2010-04-22 22:44 ---
Looks like the front-end is messing up how transparent_union is done anyways. 
It is creating a variant which is just bogus.  It should be the main variant.  


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|middle-end  |c++


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43859