This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]