public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/7065: unnamed derived classes/structs are rejected
@ 2002-06-18 6:16 daniel.frey
0 siblings, 0 replies; 4+ messages in thread
From: daniel.frey @ 2002-06-18 6:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 7065
>Category: c++
>Synopsis: unnamed derived classes/structs are rejected
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Jun 18 06:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Daniel Frey
>Release: gcc-3.1
>Organization:
>Environment:
gcc 3.1, linux, pc
>Description:
The following code is legal:
class A {};
class : A {}; // unnamed class
int main() {}
But it is rejected with:
t.cc:2: parse error before `:' token
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/7065: unnamed derived classes/structs are rejected
@ 2003-01-23 9:06 Daniel Frey
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Frey @ 2003-01-23 9:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/7065; it has been noted by GNATS.
From: Daniel Frey <daniel.frey@aixigo.de>
To: bangerth@dealii.org, daniel.frey@aixigo.de, gcc-bugs@gcc.gnu.org,
gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c++/7065: unnamed derived classes/structs are rejected
Date: Thu, 23 Jan 2003 09:58:13 +0100
bangerth@dealii.org wrote:
> =
> Synopsis: unnamed derived classes/structs are rejected
> =
> State-Changed-From-To: analyzed->closed
> State-Changed-By: bangerth
> State-Changed-When: Thu Jan 23 03:01:31 2003
> State-Changed-Why:
> Fixed with new parser. The only valid use of an unnamed struct
> is to either declare a typedef, or to name a variable:
> ------------------------
> class A {};
> typedef class : A {} B;
> class : A {} a;
> ------------------
> =
> Both uses compile just fine now. That being said, what
> an abomination of the language!
Indeed. I noticed this problem when compiling code declaring a variable.
I cut it down to report it to GNATS, but it seems I cut it down too much
(as the problem with the old parser occured before it saw the variable).
I consider it fixed now, the example I gave in the original error report
is clearly illegal. Thanks to the whole GCC team.
Regards, Daniel
-- =
Daniel Frey
aixigo AG - financial training, research and technology
Schlo=DF-Rahe-Stra=DFe 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey@aixigo.de, web: http://www.aixigo.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/7065: unnamed derived classes/structs are rejected
@ 2003-01-23 3:01 bangerth
0 siblings, 0 replies; 4+ messages in thread
From: bangerth @ 2003-01-23 3:01 UTC (permalink / raw)
To: daniel.frey, gcc-bugs, gcc-prs, nobody
Synopsis: unnamed derived classes/structs are rejected
State-Changed-From-To: analyzed->closed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 23 03:01:31 2003
State-Changed-Why:
Fixed with new parser. The only valid use of an unnamed struct
is to either declare a typedef, or to name a variable:
------------------------
class A {};
typedef class : A {} B;
class : A {} a;
------------------
Both uses compile just fine now. That being said, what
an abomination of the language!
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7065
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/7065: unnamed derived classes/structs are rejected
@ 2002-07-03 12:46 nathan
0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2002-07-03 12:46 UTC (permalink / raw)
To: daniel.frey, gcc-bugs, gcc-prs, nobody
Synopsis: unnamed derived classes/structs are rejected
State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Wed Jul 3 12:46:57 2002
State-Changed-Why:
confirmed. Apparently such stupidity is legal!
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7065
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-23 9:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-18 6:16 c++/7065: unnamed derived classes/structs are rejected daniel.frey
2002-07-03 12:46 nathan
2003-01-23 3:01 bangerth
2003-01-23 9:06 Daniel Frey
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).