https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93048

--- Comment #5 from Pilar Latiesa <pilarlatiesa at gmail dot com> ---
(In reply to Arseny Solokha from comment #3)
> It is likely a duplicate of PR93033.

It is certainly related. The fix for that PR made that all of the provided
testcases compile with yesterday spapshot (20200106).

However, this code still exhibits the problem:

#include <valarray>

template<int d, int r>
struct TTensor
{
  TTensor<d, r - 1> DatArr[d];
};

template<int d>
struct TTensor<d, 0u>
{
  double Dat;
};

template<int d, int r>
struct TCoefs
{
  double aP;
  std::valarray<double> aF;
  TTensor<d, r> b;
};


template<int d, int r>
class TExpr
{
public:
  TCoefs<d, r>
  CalcCoefs() const;
};

template<int d, int r>
TCoefs<d, r>
TExpr<d, r>::CalcCoefs() const
{
  double aP = 0.0;
  std::valarray<double> aF;
  TTensor<d, r> b = {};

  return {aP, aF, b};
}

int main()
{
  TExpr<2, 2> foo;

  auto bar = foo.CalcCoefs();

  return 0;
}

Reply via email to