c++/853: Error "`class X::Y' is private" reported at wrong line

olly@survex.com olly@survex.com
Tue Nov 21 05:16:00 GMT 2000


>Number:         853
>Category:       c++
>Synopsis:       Error "`class X::Y' is private" reported at wrong line
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 21 05:16:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     olly@survex.com
>Release:        gcc version 2.97 20001120 (experimental)
>Organization:
>Environment:
x86 GNU/Linux ( http://www.codesourcery.com/gcc-compile.shtml )
>Description:
The attached example is (I belive) incorrect C++ - the class
F::Internal is private.

gcc reports an appropriate error, but rather than reporting
it at the line where the friend class is declared, it is
reported for each member of the class apart from ctors and
dtors.

So the error is reported at lines 8 and 13 of the example,
while I would expect it to be reported at line 6 (and
nowhere else).
>How-To-Repeat:
g++ -c test.cc
>Fix:

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

Y2xhc3MgRiB7CiAgICBjbGFzcyBJbnRlcm5hbDsKfTsKCmNsYXNzIEMgewogICAgZnJpZW5kIGNs
YXNzIEY6OkludGVybmFsOwogICAgcHVibGljOgogICAgICAgIHR5cGVkZWYgZW51bSB7IEEsIEIg
fSBlOwoKCUMoKTsKCX5DKCk7CgoJdm9pZCBtKCk7Cn07Cg==


More information about the Gcc-bugs mailing list