[clang] [Clang][Sema] Don't warn on accessing virtual base from abstract class (PR #217715)

Aaron Puchert via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 22 06:40:00 PDT 2026


================
@@ -1411,6 +1411,8 @@ struct B : public A {
 
   B(int (*)[4]) : A(foo()) {}
   // expected-warning at -1 {{base_class_access::A' is uninitialized when used here to access 'base_class_access::A::foo'}}
+
+  virtual void f() = 0;
----------------
aaronpuchert wrote:

Because `A` is a non-virtual base, it has to be initialized by `B` regardless of whether `B` is abstract or not. We sill cover the non-abstract case in `D`.

But I can also drop this or add another class if you prefer. (That's what I originally had, but then decided to condense the tests a bit.)

https://github.com/llvm/llvm-project/pull/217715


More information about the cfe-commits mailing list