https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88595
ensadc at mailnesia dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ensadc at mailnesia dot com --- Comment #1 from ensadc at mailnesia dot com --- As far as I know, CTAD (class template argument deduction) is like `auto`; both are not allowed in non-static member declarations. So gcc is correct in both places. ``` template<typename T = void> struct Any { constexpr Any (int x) {} }; struct Container { auto c = 1; // error Any car; // also error }; auto c = 1; // OK Any x (2); // also OK ``` The error message can probably be improved though.