Created attachment 1349475 [details] Test case Description of problem: When optimisations are enabled, g++ fails to compile an overridden virtual method which takes a variable number of arguments, if there is another base class with virtual functions before the one with the overridden function in the base clause. Version-Release number of selected component (if applicable): gcc-7.2.1-2.fc26 How reproducible: Occurs every time. Steps to Reproduce: 1. Download test case attachment to a file called test.cpp 2. run g++ -O1 -c test.cpp Actual results: Compilation fails with the output: test.cpp:3:34: error: generic thunk code fails for method ‘virtual void<unnamed class>::_ZThn8_N3._01cEz(...)’ which uses ‘...’ class : a, b { void c(...) {} } d; ^ Expected results: An object file is produced with no error. Additional info: I think this is a regression and it previously worked on GCC 6. It can be worked around by adding the attribute [[gnu::optimize("O0")]] to any offending function definitions.
Fixed in gcc 8.