PR c++/85437
commit941fafa56b52ee2328a8695c22e66301b8d30d5e
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Apr 2018 07:10:16 +0000 (25 07:10 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 25 Apr 2018 07:10:16 +0000 (25 07:10 +0000)
tree0bb4f2c59a7c078ae71479a2a88c3202e7e2c396
parent9ce5a00d2d3b8b107cb1ca0e23bf1e31a095f9b6
PR c++/85437
PR c++/49171
* cp-tree.h (REINTERPRET_CAST_P): New.
* constexpr.c (cxx_eval_constant_expression) <case NOP_EXPR>:
Reject REINTERPET_CAST_P conversions.  Use cplus_expand_constant
for non-trivial PTRMEM_CST cases.
* typeck.c (build_nop_reinterpret): New.
(build_reinterpret_cast_1): Use it.  Set REINTERPRET_CAST_P on
NOP_EXPRs returned by cp_convert.

* g++.dg/cpp0x/addressof1.C: Make reinterpret cases runtime checks.
* g++.dg/cpp0x/constexpr-cast.C: Remove xfails
* g++.dg/cpp0x/constexpr-nullptr-2.C: Likewise.
* g++.dg/cpp0x/constexpr-pmf1.C: Check when optimized.
* g++.dg/cpp0x/pr85437-1.C: New.
* g++.dg/cpp0x/pr85437-2.C: New.
* g++.dg/cpp0x/pr85437-3.C: New.
* g++.dg/cpp0x/pr85437-4.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@259629 138bc75d-0d04-0410-961f-82ee72b054a4
13 files changed:
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/cp/cp-tree.h
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/addressof1.C
gcc/testsuite/g++.dg/cpp0x/constexpr-cast.C
gcc/testsuite/g++.dg/cpp0x/constexpr-nullptr-2.C
gcc/testsuite/g++.dg/cpp0x/constexpr-pmf1.C
gcc/testsuite/g++.dg/cpp0x/pr85437-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr85437-2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr85437-3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/pr85437-4.C [new file with mode: 0644]