public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/4652: anonymous struct names conflict with namespaces
@ 2001-10-25 16:26 gawrilow
  0 siblings, 0 replies; only message in thread
From: gawrilow @ 2001-10-25 16:26 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4652
>Category:       c++
>Synopsis:       anonymous struct names conflict with namespaces
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 25 16:26:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Ewgenij Gawrilow
>Release:        3.0.1
>Organization:
>Environment:
Solaris 8 @ UltraSPARC
>Description:
If a class member of an anonymous struct type has the same
name as some namespace declared earlier, the compiler reports
a "parse error". If the struct definition is separated from
the member declaration, however, everything goes well. 
>How-To-Repeat:
Compile the attached code without and with -DWORKAROUND.
>Fix:
A workaround is illustrated in the attached sample code.

Personally I don't like this style; however, there is a lot
of code written in this manner (in my case it was GTK)
which one might want to weave together with own things.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="unnamed.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="unnamed.cc"

bmFtZXNwYWNlIEZvbyB7IH07CgpjbGFzcyBCbGEgewoKI2lmZGVmIFdPUktBUk9VTkQKICAgdHlw
ZWRlZgojZW5kaWYKICAgc3RydWN0IHsKICAgICAgaW50IHg7CiAgICAgIGRvdWJsZSB5OwogICB9
CiNpZmRlZiBXT1JLQVJPVU5ECiAgIF9Gb287CiAgIF9Gb28gRm9vOwojZWxzZQogICBGb287CiNl
bmRpZgoKfTsKCmludCBtYWluKCkgewogICBCbGEgYjsKICAgcmV0dXJuIDA7Cn0K


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-25 16:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-25 16:26 c++/4652: anonymous struct names conflict with namespaces gawrilow

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