[Bug c++/63715] Compiler giving "reinterpret_cast from integer to pointer" in constexpr function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Nov 2 20:54:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63715

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> gccbug.cc:15:43: error: reinterpret_cast from integer to pointer

> But the result of the expression is well-defined in compile time...
> Moreover, gcc-4.8.3 compiles this code just fine.

Yes it might be well-defined outside of a constexpr but it is not allowed
inside a constexpr as mentioned by the C++ standard.  Basically 4.8.x did not
implement all constraints on constexpr and 4.9 does.



More information about the Gcc-bugs mailing list