Even if you declare a forward class D the error still persists...

struct A2 {
  struct B {};
  struct D;
  consteval {
      -> fragment struct {
          B b = D();               //error
          B getB() { return D(); } //error
      };
  }
  struct D : B {};
};


Well, yeah. D hasn't been defined at the point it's used.

Andrew