This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/30928] add casts to libc overloads
- From: "marc dot glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2010 20:35:24 -0000
- Subject: [Bug libstdc++/30928] add casts to libc overloads
- References: <bug-30928-6008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from marc dot glisse at normalesup dot org 2010-01-14 20:35 -------
(In reply to comment #4)
> It seems to me extremely unlikely that an implementation decides to provide the
> full-const version when called by a c++ compiler and nothing else, because C++
> does *not* add an overload, *replaces both*. Thus it seems definitely
> premature.
As mentionned in the original bug report, on solaris, it is quite easy to get
this behavior. However, I agree that it is not the right way to do it, and the
apparition of macros like __CORRECT_ISO_CPP_WCHAR_H_PROTO seems like a much
better way to handle things. In some sense the main interest of this bug is to
show one way to get c* headers that don't pollute the global namespace on
solaris. But "resolved invalid" is right. #33935 (shouldn't that one be
unmerged?) is a better place to track the incomplete resolution of DR456 wrt
strchr.
> About the unrelated point at the beginning, the const_cast in wcschr, that is
> *essential* otherwise how can the forwarding to the *other* overload happen?
Er, yes, that's obvious. I have no idea what I was thinking when I wrote that
(3 years ago). Maybe just that it is a cast in the direction non-const->const
(not that it matters).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30928