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

            Bug ID: 102753
           Summary: ICE on invalid use of pointer to a consteval member
                    function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aaron at aaronballman dot com
  Target Milestone: ---

The following code crashes GCC instead of giving an error:

struct test {
  consteval int f() const { return 12; }
};

constexpr test t;
int main() {
  (t.*&test::f)();
}

Note that the call to the PMF is not in a constant evaluated context.

https://godbolt.org/z/beWhE9qMv

Reply via email to