This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/63715] Compiler giving "reinterpret_cast from integer to pointer" in constexpr function
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 02 Nov 2014 20:54:13 +0000
- Subject: [Bug c++/63715] Compiler giving "reinterpret_cast from integer to pointer" in constexpr function
- Auto-submitted: auto-generated
- References: <bug-63715-4 at http dot gcc dot gnu dot org/bugzilla/>
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.