]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: constexpr PMF conversion [PR105996]
authorJason Merrill <jason@redhat.com>
Thu, 23 Mar 2023 20:50:09 +0000 (16:50 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 18 Apr 2023 20:44:28 +0000 (16:44 -0400)
commit12d7fb7e5810cc5e394d3cbea43d1b19ea7f9348
tree5cef0e15f6ae5edacb26cc01a65322d5b098dd1a
parent94569d91bd4c604da755b4aae84256e7fe21196a
c++: constexpr PMF conversion [PR105996]

Here, we were calling build_reinterpret_cast regardless of whether there was
actually a cast, and that now sets REINTERPRET_CAST_P.  But that
optimization seems dodgy anyway, as it involves NOP_EXPR from one
RECORD_TYPE to another and we try to reserve NOP_EXPR for fundamental types.
And the generated code seems the same, so let's drop it.  And also strip
location wrappers.

PR c++/105996

gcc/cp/ChangeLog:

* typeck.cc (build_ptrmemfunc): Drop 0-offset optimization
and location wrappers.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-pmf3.C: New test.
gcc/cp/typeck.cc
gcc/testsuite/g++.dg/cpp0x/constexpr-pmf3.C [new file with mode: 0644]