public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/80456] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
@ 2020-09-23  3:43 ` lebed.dmitry at gmail dot com
  2021-04-15 13:17 ` [Bug c++/80456] [8/9/10/11 Regression] " ppalka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: lebed.dmitry at gmail dot com @ 2020-09-23  3:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Dmitry Lebed <lebed.dmitry at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lebed.dmitry at gmail dot com

--- Comment #7 from Dmitry Lebed <lebed.dmitry at gmail dot com> ---
Just encountered the same issue independently
https://stackoverflow.com/questions/64019728/are-there-any-caveats-in-c-with-constexpr-static-function-usage-in-volatile

It's sad to see that it's already 3 years without fix.
It's still valid for GCC trunk (according to godbolt) and at 10.2 (according to
my local tests).

Any hope in fixing this?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
  2020-09-23  3:43 ` [Bug c++/80456] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression lebed.dmitry at gmail dot com
@ 2021-04-15 13:17 ` ppalka at gcc dot gnu.org
  2021-04-15 19:05 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-04-15 13:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Patrick Palka <ppalka at gcc dot gnu.org> 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 <ppalka at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
  2020-09-23  3:43 ` [Bug c++/80456] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression lebed.dmitry at gmail dot com
  2021-04-15 13:17 ` [Bug c++/80456] [8/9/10/11 Regression] " ppalka at gcc dot gnu.org
@ 2021-04-15 19:05 ` jason at gcc dot gnu.org
  2021-04-15 20:32 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-15 19:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Jason Merrill <jason at gcc dot gnu.org> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [8/9/10/11 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-04-15 19:05 ` jason at gcc dot gnu.org
@ 2021-04-15 20:32 ` cvs-commit at gcc dot gnu.org
  2021-04-15 20:34 ` [Bug c++/80456] [8/9/10 " jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-15 20:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

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

commit r11-8203-g3682052e4ccf0a29d1f61df1c8e31f8190eafafe
Author: Jason Merrill <jason@redhat.com>
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [8/9/10 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-04-15 20:32 ` cvs-commit at gcc dot gnu.org
@ 2021-04-15 20:34 ` jason at gcc dot gnu.org
  2021-05-14  9:48 ` [Bug c++/80456] [9/10 " jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2021-04-15 20:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.0
            Summary|[8/9/10/11 Regression]      |[8/9/10 Regression] calling
                   |calling constexpr member    |constexpr member function
                   |function from               |from volatile-qualified
                   |volatile-qualified member   |member function: error:
                   |function: error: ‘this’ is  |‘this’ is not a constant
                   |not a constant expression   |expression
      Known to fail|11.0                        |

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 11 so far.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [9/10 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-04-15 20:34 ` [Bug c++/80456] [8/9/10 " jason at gcc dot gnu.org
@ 2021-05-14  9:48 ` jakub at gcc dot gnu.org
  2021-05-20 21:36 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [9/10 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-05-14  9:48 ` [Bug c++/80456] [9/10 " jakub at gcc dot gnu.org
@ 2021-05-20 21:36 ` cvs-commit at gcc dot gnu.org
  2021-05-21 14:50 ` cvs-commit at gcc dot gnu.org
  2021-05-21 14:51 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-20 21:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:75c5c4ab2662a92f0e3811cb17e27cc61814b400

commit r10-9856-g75c5c4ab2662a92f0e3811cb17e27cc61814b400
Author: Jason Merrill <jason@redhat.com>
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [9/10 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-05-20 21:36 ` cvs-commit at gcc dot gnu.org
@ 2021-05-21 14:50 ` cvs-commit at gcc dot gnu.org
  2021-05-21 14:51 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-21 14:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:0c6b4e661d875410535e17a9d82e6a0d09f28c65

commit r9-9547-g0c6b4e661d875410535e17a9d82e6a0d09f28c65
Author: Jason Merrill <jason@redhat.com>
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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/80456] [9/10 Regression] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression
       [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-05-21 14:50 ` cvs-commit at gcc dot gnu.org
@ 2021-05-21 14:51 ` jason at gcc dot gnu.org
  8 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2021-05-21 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80456

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #14 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 9.4/10.4/11.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-05-21 14:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-80456-4@http.gcc.gnu.org/bugzilla/>
2020-09-23  3:43 ` [Bug c++/80456] calling constexpr member function from volatile-qualified member function: error: ‘this’ is not a constant expression lebed.dmitry at gmail dot com
2021-04-15 13:17 ` [Bug c++/80456] [8/9/10/11 Regression] " ppalka at gcc dot gnu.org
2021-04-15 19:05 ` jason at gcc dot gnu.org
2021-04-15 20:32 ` cvs-commit at gcc dot gnu.org
2021-04-15 20:34 ` [Bug c++/80456] [8/9/10 " jason at gcc dot gnu.org
2021-05-14  9:48 ` [Bug c++/80456] [9/10 " jakub at gcc dot gnu.org
2021-05-20 21:36 ` cvs-commit at gcc dot gnu.org
2021-05-21 14:50 ` cvs-commit at gcc dot gnu.org
2021-05-21 14:51 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).