[Bug c++/85437] [8 Regression] member pointer static upcast rejected in a constexpr context
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Apr 17 15:07:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85437
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
convert_ptrmem here creates a NOP_EXPR around the PTRMEM_CST, even when it is
for a static cast rather than reinterpret_cast. The OFFSET_TYPEs are
different, but they have the same TREE_TYPE etc.
Then constexpr.c doesn't consider that cast to be usable in constant
expressions and because it is called with allow_non_constant, it wraps the new
PTRMEM_CST with another NOP_EXPR and that is where following constexpr.c call
errors on.
More information about the Gcc-bugs
mailing list