error: anachronistic old-style base class initializer
问题 The following code produces the subsequent compilation error on all versions of GCC that I've tried, in C++98, C++11 and C++14 modes: struct T { T(void* x) : (x) {} }; // main.cpp: In constructor 'T::T(void*)': // main.cpp:3:18: error: anachronistic old-style base class initializer [-fpermissive] // T(void* x) : (x) {} // ^ // main.cpp:3:16: error: unnamed initializer for 'T', which has no base classes // T(void* x) : (x) {} Sure, it's clearly broken code because I'm not actually initialising