This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51379] reinterpret_cast is not particularly useful
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Dec 2011 13:58:29 +0000
- Subject: [Bug c++/51379] reinterpret_cast is not particularly useful
- Auto-submitted: auto-generated
- References: <bug-51379-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51379
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-12-01 13:58:29 UTC ---
I wonder about the C++11 wording though, in C++03 it said:
"The reinterpret_cast operator shall not cast away constness. [Note: see 5.2.11
for the definition of ââcasting away constnessââ. Subject to the restrictions
in this section, an expression may be cast to its own type using a
reinterpret_cast operator. ]"
but in C++11:
"The reinterpret_cast operator shall not cast away constness (5.2.11). An
expression of integral, enumeration, pointer, or pointer-to-member type can be
explicitly converted to its own type; such a cast yields the
value of its operand."
For the latter wording it isn't obvious if the second sentence is subject to
the other restrictions or not.