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

            Bug ID: 93633
           Summary: ICE on consteval virtual
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tyker at outlook dot com
  Target Milestone: ---

I know that consteval virtual is not yet supported. but not crashing seems like
that bare minimum.

gcc trunk currently crashes on the following code.
struct A {
    consteval virtual int f() {
        return 1;
    }
};

struct B : A {
    consteval virtual int f() {
        return 0;
    }
};

consteval int f() {
    A* a = new B();
    return a->f();
}

int main() {
    return f();
}

https://godbolt.org/z/TR5tLZ

Reply via email to