]> gcc.gnu.org Git - gcc.git/commit
c++: constexpr and volatile member function [PR80456]
authorJason Merrill <jason@redhat.com>
Thu, 15 Apr 2021 19:13:18 +0000 (15:13 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 20 May 2021 21:08:32 +0000 (17:08 -0400)
commit75c5c4ab2662a92f0e3811cb17e27cc61814b400
treeaeba3dd5883eb5b2b807109a40d30085cc56c8ad
parentfe0f9ef823dda3205638a2f23d08eb7d0bc497b9
c++: constexpr and volatile member function [PR80456]

When calling a static member function we still need to evaluate an explicit
object argument.  But we don't want to force a load of the entire object
if the argument is volatile, so we take its address.  If as a result it no
longer has any side-effects, we don't need to evaluate it after all.

gcc/cp/ChangeLog:

PR c++/80456
* call.c (build_new_method_call_1): Check again for side-effects
with a volatile object.

gcc/testsuite/ChangeLog:

PR c++/80456
* g++.dg/cpp0x/constexpr-volatile3.C: New test.
gcc/cp/call.c
gcc/testsuite/g++.dg/cpp0x/constexpr-volatile3.C [new file with mode: 0644]
This page took 0.068385 seconds and 6 git commands to generate.