public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102786] New: PMF constant evaluation bug
@ 2021-10-15 18:05 jakub at gcc dot gnu.org
  2021-10-15 19:22 ` [Bug c++/102786] " pinskia at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-10-15 18:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102786
           Summary: PMF constant evaluation bug
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

In the following testcase:

// { dg-do compile { target c++20 } }

struct S {
  virtual constexpr int foo () const { return 42; }
};

constexpr S s;
constexpr auto a = &S::foo;
constexpr auto b = (s.*a) ();
constexpr auto c = (s.*&S::foo) ();

we correctly accept b's initializer, but reject c's initializer with:
error: value ‘1’ of type ‘int (S::*)() const’ is not a constant expression

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

end of thread, other threads:[~2022-10-28 23:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 18:05 [Bug c++/102786] New: PMF constant evaluation bug jakub at gcc dot gnu.org
2021-10-15 19:22 ` [Bug c++/102786] " pinskia at gcc dot gnu.org
2021-10-15 20:32 ` pinskia at gcc dot gnu.org
2021-10-19  7:25 ` [Bug c++/102786] [c++20] virtual pmf sometimes rejected as not a constant cvs-commit at gcc dot gnu.org
2021-11-29  8:49 ` cvs-commit at gcc dot gnu.org
2021-11-29  9:08 ` jakub at gcc dot gnu.org
2022-05-10  8:21 ` cvs-commit at gcc dot gnu.org
2022-05-11  6:22 ` cvs-commit at gcc dot gnu.org
2022-10-28 23:28 ` pinskia 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).