c++/590: incorrect compiler errors generated on temporary stream constructor

david@gravitext.com david@gravitext.com
Mon Oct 2 19:36:00 GMT 2000


>Number:         590
>Category:       c++
>Synopsis:       incorrect compiler errors generated on temporary stream constructor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 02 19:36:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     David Kellum
>Release:        gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
>Organization:
>Environment:
Linux gypsy 2.2.14 #1 SMP Wed Mar 15 22:09:41 EST 2000 i686 unknown
>Description:
Applying this command line:
g++ -g oneparam.cpp -o oneparam

To the attached file yields the following:

oneparam.cpp: In function `int main()':
oneparam.cpp:45: `class BadStream BadStream::VALUE' is not a static member of `class BadStream'
oneparam.cpp:45: no matching function for call to `BadStream::BadStream ()'
oneparam.cpp:25: candidates are: BadStream::BadStream(const BadStream &)
oneparam.cpp:23:                 BadStream::BadStream(BadStream::InternalEnum)
oneparam.cpp:24:                 BadStream::BadStream(BadStream::InternalEnum, int)
oneparam.cpp:45: parse error before `<'

I believe the errors are incorrect.
>How-To-Repeat:
Compile attached with this:
g++ -g oneparam.cpp -o oneparam
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="oneparam.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="oneparam.cpp"

CiNpbmNsdWRlIDxpb3N0cmVhbS5oPgojaW5jbHVkZSA8c3Ryc3RyZWFtLmg+CgoKZW51bSBFeHRl
cm5hbEVudW0geyBFWFRFUk5BTF9WQUxVRSA9IDIgfTsKCmNsYXNzIEdvb2RTdHJlYW0gOiBwdWJs
aWMgb3N0cnN0cmVhbSAKewpwdWJsaWM6CiAgICAKICAgIEdvb2RTdHJlYW0oIEV4dGVybmFsRW51
bSBzICkge307Cgpwcml2YXRlOgogICAgR29vZFN0cmVhbSggY29uc3QgR29vZFN0cmVhbSAmICk7
Cn07CgoKY2xhc3MgQmFkU3RyZWFtIDogcHVibGljIG9zdHJzdHJlYW0gCnsgICAgCnB1YmxpYzog
CiAgICBlbnVtIEludGVybmFsRW51bSB7IFZBTFVFID0gMCB9OyAgIAogICAgQmFkU3RyZWFtKCBJ
bnRlcm5hbEVudW0gZSApIHt9OwogICAgQmFkU3RyZWFtKCBJbnRlcm5hbEVudW0gZSwgaW50IGkg
KSB7fTsKfTsKCgppbnQgbWFpbigpIAp7CiAgICAvLyBUaGlzIGNvbXBpbGVzOgogICAgR29vZFN0
cmVhbSggRVhURVJOQUxfVkFMVUUgKSA8PCAiZm9vYmFyIiA8PCBlbmRsOwoKIAogICAgKCBCYWRT
dHJlYW0oIEJhZFN0cmVhbTo6VkFMVUUgKSApIDw8ICJmb29iYXIiIDw8IGVuZGw7CgogICAgQmFk
U3RyZWFtKCAoQmFkU3RyZWFtOjpJbnRlcm5hbEVudW0pIEJhZFN0cmVhbTo6VkFMVUUgKSA8PCAi
Zm9vYmFyIjsKCiAgICBCYWRTdHJlYW06OkludGVybmFsRW51bSBpbiA9IEJhZFN0cmVhbTo6VkFM
VUU7CiAgICBCYWRTdHJlYW0oIGluICkgPDwgImZvb2JhciI7CiAgICAKICAgIEJhZFN0cmVhbSgg
QmFkU3RyZWFtOjpWQUxVRSwgMCApIDw8ICJmb29iYXIiIDw8IGVuZGw7CgogICAgCiAgICAvLyBU
aGlzIGRvZXNuJ3QgY29tcGlsZToKICAgIEJhZFN0cmVhbSggQmFkU3RyZWFtOjpWQUxVRSApIDw8
ICJmb29iYXIiIDw8IGVuZGw7CgogICAgCgogICAgcmV0dXJuIDE7Cn0KCg==


More information about the Gcc-bugs mailing list