struct A { const int j; virtual void foo() {} }; int main() { //A a{}; A * aa = new A(); return 0; }
Standard input is empty
prog.cpp:2:12: warning: non-static const member ‘const int A::j’ in class without a constructor [-Wuninitialized] const int j; ^ prog.cpp: In function ‘int main()’: prog.cpp:8:17: error: use of deleted function ‘A::A()’ A * aa = new A(); ^ prog.cpp:1:8: note: ‘A::A()’ is implicitly deleted because the default definition would be ill-formed: struct A { ^ prog.cpp:1:8: error: uninitialized non-static const member ‘const int A::j’ prog.cpp:8:6: warning: unused variable ‘aa’ [-Wunused-variable] A * aa = new A(); ^
Standard output is empty