We warn about undefined calls to pure virtual functions from constructors and destructors: struct Base { virtual void f() = 0; Base() { f(); } }; <source>: In constructor 'Base::Base()': <source>:3:15: warning: pure virtual 'virtual void Base::f()' called from constructor 3 | Base() { f(); } | ~^~ But for indirect calls we don't warn: struct Base { virtual void f() = 0; Base() { g(); } void g() { f(); } }; It would be good if IPA could warn for this case too. After g() is inlined into the constructor we know that the call to f() is undefined. I assume this would mean moving the warning from the front end to the middle end.
.
Dup. will update that bug. *** This bug has been marked as a duplicate of bug 47940 ***