public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/9014: unnamed classes cannot have base classes
@ 2002-12-19 19:56 martin
  0 siblings, 0 replies; 2+ messages in thread
From: martin @ 2002-12-19 19:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9014
>Category:       c++
>Synopsis:       unnamed classes cannot have base classes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 19 19:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     martin@xemacs.org
>Release:        gcc-3.2.1
>Organization:
>Environment:
Linux x86
>Description:
C++ classes can be unnamed.
C++ classes can have base classes.
Orthogonality suggests they can do both.

The following should compile (and indeed does under
Intel's icc and Comeau C++'s test drive):

class A {};
class {} x;              // OK
class B : public A {} y; // OK
class : public A {} z;   // parse error


(martin@wobble) ~/src/toy $ gcc -c unnamed-inheritor.cc
unnamed-inheritor.cc:4: parse error before `:' token
unnamed-inheritor.cc:4: ISO C++ forbids declaration of `z' with no type

This grammar production

class-head:
    class-key identifieropt base-clauseopt

suggests that both the class name and the base clause are
independently optional.
>How-To-Repeat:
See description
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c++/9014: unnamed classes cannot have base classes
@ 2002-12-20 11:35 bangerth
  0 siblings, 0 replies; 2+ messages in thread
From: bangerth @ 2002-12-20 11:35 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, martin, nobody

Synopsis: unnamed classes cannot have base classes

State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Fri Dec 20 11:35:29 2002
State-Changed-Why:
    Duplicate of PR 7065.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9014


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

end of thread, other threads:[~2002-12-20 19:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-19 19:56 c++/9014: unnamed classes cannot have base classes martin
2002-12-20 11:35 bangerth

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).