c++/4652: anonymous struct names conflict with namespaces
gawrilow@math.tu-berlin.de
gawrilow@math.tu-berlin.de
Thu Oct 25 16:26:00 GMT 2001
>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
More information about the Gcc-prs
mailing list