c++/6596: Regression on C++ code.

Theodore.Papadopoulo@sophia.inria.fr Theodore.Papadopoulo@sophia.inria.fr
Tue May 7 10:36:00 GMT 2002


>Number:         6596
>Category:       c++
>Synopsis:       Regression on C++ code.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 07 10:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Theodore.Papadopoulo@sophia.inria.fr
>Release:        gcc version 3.2 20020424 (experimental)
>Organization:
>Environment:
Gnu/Linux 2.2.18
Gnu libc-2.1.3.so
>Description:
The program below does not compile with gcc version 3.2 20020424

vanuatu->g++ toto.C
toto.C: In copy constructor `A::H::H(const A::H&)':
toto.C:13: `const' qualifiers cannot be applied to `A&'

Remove the line with virtual and everything suddenly becomes fine. Something there is inconsistent. It worked with the 3.0 series and with 3.1 20011022 (experimental). In my opinion, the program should be valid, confirmed by my reading of the C++ standard (12.8.5).

I do not have access to a current 3.1 version.
>How-To-Repeat:
Just compile the code in attachment.
>Fix:
Remove the pure virtual declaration.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="toto.C"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="toto.C"

c3RydWN0IEEgewogICAgc3RydWN0IEggewogICAgICAgIEEmIGE7CiAgICAgICAgSChBJiBiKTog
YShiKSB7IH0KICAgICAgICB2aXJ0dWFsIG9wZXJhdG9yIGludCgpIGNvbnN0ID0gMDsKICAgIH07
CgogICAgc3RydWN0IFI6IHB1YmxpYyBIIHsKICAgICAgICBSKEEmIGEpOkgoYSkgeyB9CiAgICAg
ICAgb3BlcmF0b3IgaW50KCkgY29uc3QgeyByZXR1cm4gMTsgfQogICAgfTsKCiAgICBSIHIoKSB7
IHJldHVybiBSKCp0aGlzKTsgfQp9OwoKaW50Cm1haW4oKQp7CiAgICBBIGE7CiAgICBpbnQgaSA9
IGEucigpOwp9Cg==



More information about the Gcc-bugs mailing list