[Bug c++/70774] constexpr function with reference parameter gives reinterpret_cast from integer to pointer error

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 12 21:31:00 GMT 2016


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |msebor at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
The test case is invalid because a constexpr expression cannot make use of
reinterpret_cast (which is what the C-style cast in the definition of the PORTX
macro is equivalent to).  That GCC 4.8.2 accepts it is a bug in that version of
the compiler.  It was fixed in r197209 (to resolve bug 56728).


More information about the Gcc-bugs mailing list