]> gcc.gnu.org Git - gcc.git/commit
c++: C++17 and decltype of multi-operator expression [PR95675]
authorJason Merrill <jason@redhat.com>
Wed, 3 Mar 2021 04:59:00 +0000 (23:59 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 3 Mar 2021 13:47:03 +0000 (08:47 -0500)
commit74aee6d20872e8d87558eb5bf601042e3ed3fb2a
tree7c77a9a101ce563964138373cf31b0c8a6aa2f2f
parent5bc3a2bc8a810e7a9a51d7069463f1f460d6a588
c++: C++17 and decltype of multi-operator expression [PR95675]

A call that is the immediate operand of decltype has special semantics: no
temporary is produced, so it's OK for the return type to be e.g. incomplete.
But we were treating (e | f) the same way, which confused overload
resolution when we then tried to evaluate ... | g.

Fixed by making build_temp do what its name says, and force the C++17
temporary materialization conversion.

gcc/cp/ChangeLog:

PR c++/95675
* call.c (build_temp): Wrap a CALL_EXPR in a TARGET_EXPR
if it didn't get one before.

gcc/testsuite/ChangeLog:

PR c++/95675
* g++.dg/cpp0x/decltype-call5.C: New test.
* g++.dg/cpp0x/decltype-call6.C: New test.
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/decltype-call5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/decltype-call6.C [new file with mode: 0644]
This page took 0.066894 seconds and 6 git commands to generate.