c++/641: annoying warning with friends, templates, and const
bh@techhouse.brown.edu
bh@techhouse.brown.edu
Sat Oct 14 22:46:00 GMT 2000
>Number: 641
>Category: c++
>Synopsis: annoying warning with friends, templates, and const
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Sat Oct 14 22:46:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: bh@techhouse.brown.edu
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
solaris 2.6
>Description:
See the example. What gcc notices is that classes
iterator<const A> ; and
iterator<const const A>
are identical. It then issues a warning.
The warning is unfortunate: the code is perfectly safe,
and the two declarations make sense for a non-const type.
>How-To-Repeat:
gcc warns.cc
>Fix:
Can't find the switch to turn the offensive warning off;
I can remove the cv-quals from my template instantiation,
or just ignore the warning.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="warns.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="warns.cc"
dGVtcGxhdGUgPGNsYXNzIFQ+IGNsYXNzIGl0ZXJhdG9yIHsgfTsKdGVtcGxhdGUgPGNsYXNzIFQ+
IGNsYXNzIGl0ZW0gewogICAgZnJpZW5kIGNsYXNzIGl0ZXJhdG9yPFQ+OwogICAgZnJpZW5kIGNs
YXNzIGl0ZXJhdG9yPGNvbnN0IFQ+Owp9OwoKY2xhc3MgQSB7IH07CgppdGVtPGNvbnN0IEE+IGk7
Cg==
More information about the Gcc-bugs
mailing list