https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93048
--- Comment #2 from Pilar Latiesa <pilarlatiesa at gmail dot com> --- Even more reduced: #include <valarray> template<int d, int r1> struct TTensor {}; template<int d, int r> struct TCoefs { double aP; std::valarray<double> aF; TTensor<d, r> b; }; template<int d, int r> class TExprDiv { public: TCoefs<d, r> CalcCoefs(int) const; }; template<int d, int r> TCoefs<d, r> TExprDiv<d, r>::CalcCoefs(int) const { double aP = 0.0; return {aP, {}, {}}; } int main() { auto bar = TExprDiv<2u, 1u>().CalcCoefs(0); return 0; }