re PR c++/89599 (C-style function-pointer-to-void* cast is handled inconsistently)
authorJakub Jelinek <jakub@redhat.com>
Fri, 8 Mar 2019 07:43:58 +0000 (08:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 8 Mar 2019 07:43:58 +0000 (08:43 +0100)
commited3ea9f271aecfdea1650c87f835efa70a6f1bac
treea4f0892b801ff3c5b2db353e1db1b132b8aed8b3
parent560a46a5914a3cc55ade0cb0fe3d8e36d85d01cd
re PR c++/89599 (C-style function-pointer-to-void* cast is handled inconsistently)

PR c++/89599
* constexpr.c (potential_constant_expression_1): Reject
REINTERPRET_CAST_P NOP_EXPRs.

* g++.dg/ubsan/vptr-4.C: Adjust expected diagnostics.
* g++.dg/parse/array-size2.C: Likewise.
* g++.dg/cpp0x/constexpr-89599.C: New test.

From-SVN: r269482
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/constexpr-89599.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/array-size2.C
gcc/testsuite/g++.dg/ubsan/vptr-4.C