https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96636
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work| |4.1.2 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- 4.1.2 used to accept this code without any error message (well changing b{} to b()). 4.4.7 gives: <source>: In function 'void foo()': <source>:3: error: 'b::<anonymous struct>::._1()' is inaccessible <source>:5: error: within this context 4.5.3 adds: <source>:5:16: error: using result of function returning 'void' 4.6+ change the last error message into an ICE 4.8.1 gives a better error message: <source>:3:11: error: 'b::<anonymous struct>::<constructor>()' is inaccessible struct : virtual a {}; ^ <source>:5:15: error: within this context void foo(){ b();} ^ 4.9 ICEs in: source>:5:16: internal compiler error: in count_type_elements, at expr.c:5620 void foo(){ b();} ^ mmap: Invalid argument Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. 5+ now ICEs in build_value_init_noctor.