[Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression

2021-04-15 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

--- Comment #9 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:3682052e4ccf0a29d1f61df1c8e31f8190eafafe

commit r11-8203-g3682052e4ccf0a29d1f61df1c8e31f8190eafafe
Author: Jason Merrill 
Date:   Thu Apr 15 15:13:18 2021 -0400

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.

[Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression

2021-04-15 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
  Known to work||7.5.0
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression

2021-04-15 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Patrick Palka  changed:

   What|Removed |Added

  Known to work||4.8.1
Summary|calling constexpr member|[8/9/10/11 Regression]
   |function from   |calling constexpr member
   |volatile-qualified member   |function from
   |function: error: ‘this’ is  |volatile-qualified member
   |not a constant expression   |function: error: ‘this’ is
   ||not a constant expression
  Known to fail||10.3.0, 11.0, 8.4.0, 9.3.0
 CC||ppalka at gcc dot gnu.org
   Target Milestone|--- |8.5

--- Comment #8 from Patrick Palka  ---
We apparently started rejecting the testcase starting with GCC 4.9 (r0-122547
or perhaps r0-122549); GCC 4.8 accepts.  So I suppose we should consider this
PR a regression.