public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19244] New: Typedef of anonymous class incorrectly handled in member function definition
@ 2005-01-03 21:00 austern at apple dot com
  2005-01-03 21:07 ` [Bug c++/19244] [4.0 Regression] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: austern at apple dot com @ 2005-01-03 21:00 UTC (permalink / raw)
  To: gcc-bugs

gcc 4.0 incorrectly rejects the following valid code:
typedef struct { void f(); } f;
void f::f() { }

It treats f::f as referring to a constructor, and then gets confused because this isn't the right syntax for 
a constructor definition.  However (12.1/3), "a typedef-name that names a class shall not be used as 
the identifier in the declarator for a constructor declaration."

Note that this only happens for an anonymous class.  If I instead write
typedef struct e { void f(); } f;
then this compiles without error.

This is a regression.  3.3 handles this correctly.

-- 
           Summary: Typedef of anonymous class incorrectly handled in member
                    function definition
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: austern at apple dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: powerpc-apple-darwin7.7.0
  GCC host triplet: powerpc-apple-darwin7.7.0
GCC target triplet: powerpc-apple-darwin7.7.0


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-01-06 20:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-03 21:00 [Bug c++/19244] New: Typedef of anonymous class incorrectly handled in member function definition austern at apple dot com
2005-01-03 21:07 ` [Bug c++/19244] [4.0 Regression] " pinskia at gcc dot gnu dot org
2005-01-04 15:50 ` pinskia at gcc dot gnu dot org
2005-01-06 16:38 ` mmitchel at gcc dot gnu dot org
2005-01-06 20:21 ` mmitchel at gcc dot gnu dot org
2005-01-06 20:21 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).