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

--- Comment #4 from Fedor Uvarov <acharvak at pm dot me> ---
The issue still exists as of gcc version 16.0.0 20251231 (experimental).

Curiously, it doesn't always occur. I've only encountered it when Derived is
allocated with new. For example, the following does compile:

struct B { virtual ~B() = default; };
struct D : B { constexpr ~D() override { } };
int main() {
  []() consteval {
    D d {};
    B* b = &d;
    dynamic_cast<D&>(*b);
  }();
}

Reply via email to