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
>Originator:     bh@techhouse.brown.edu
>Release:        gcc version 2.95.2 19991024 (release)
solaris 2.6
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.
gcc warns.cc
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.
Content-Type: application/octet-stream; name="warns.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="warns.cc"


More information about the Gcc-bugs mailing list