[Bug c++/15471] [3.4/3.5 Regression] Incorrect member pointer offsets in anonymous structs/unions

giovannibajo at libero dot it gcc-bugzilla@gcc.gnu.org
Wed May 26 18:49:00 GMT 2004


------- Additional Comments From giovannibajo at libero dot it  2004-05-26 12:07 -------
I couldn't find the relevant paragraph in the standard, thus I am not sure this 
is actually legal code. It must be noted that EDG in strict mode accepts it and 
generates the same address for both pointers (which is by no doubt the correct 
behaviour, once we assume the code is legal).

GCC rejects this snippet up to 3.4. Since 3.4, we accept the snippet but 
generate wrong code with it. I rate this as a regression nonetheless, since 
wrong-code is much worse than what we used to do.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |giovannibajo at libero dot
                   |                            |it
           Severity|normal                      |critical
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |wrong-code
      Known to fail|                            |2.95.3 3.0.4 3.3.3 3.4.0
                   |                            |3.5.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-05-26 12:07:55
               date|                            |
            Summary|Incorrect member pointer    |[3.4/3.5 Regression]
                   |offsets in anonymous        |Incorrect member pointer
                   |structs/unions              |offsets in anonymous
                   |                            |structs/unions
   Target Milestone|---                         |3.4.1


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



More information about the Gcc-bugs mailing list