https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91286
Bug ID: 91286
Summary: invalid use of incomplete type depends on
--enable-checking=release
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marxin at gcc dot gnu.org
Target Milestone: ---
If you consider test-case from
https://gcc.gnu.org/bugzilla/attachment.cgi?id=46632
I see:
$ g++ batch.ii -c
batch.ii: In instantiation of ‘const int TensorEvaluator<const
TensorChippingOp<1, const TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1>
>, int>::NumInputDims’:
batch.ii:124:30: required from ‘const int TensorEvaluator<const
TensorChippingOp<1, const TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1>
>, int>::NumDims’
batch.ii:125:24: required from ‘struct TensorEvaluator<const
TensorChippingOp<1, const TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1>
>, int>’
batch.ii:128:8: required from ‘struct TensorEvaluator<TensorChippingOp<0,
const TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1> >, int>’
batch.ii:147:40: required from ‘struct TensorEvaluator<const
TensorAssignOp<TensorChippingOp<0, const TensorMap<Trans_NS_Eigen_Tensor<int,
3, 1, int>, 1> >, const TensorContractionOp<array<int, 1>, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, int> >, int>’
batch.ii:165:5: required from here
batch.ii:123:20: error: invalid use of incomplete type ‘const class
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1>’
123 | static const int NumInputDims = H<typename
ArgType::Dimensions>::value;
| ^~~~~~~~~~~~
batch.ii:18:60: note: declaration of ‘class
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 1, int>, 1>’
18 | template <typename, int, template <class> class = B> class TensorMap;
| ^~~~~~~~~
batch.ii: In instantiation of ‘const int TensorEvaluator<const
TensorChippingOp<1, TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >,
int>::NumInputDims’:
batch.ii:124:30: required from ‘const int TensorEvaluator<const
TensorChippingOp<1, TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >,
int>::NumDims’
batch.ii:125:24: required from ‘struct TensorEvaluator<const
TensorChippingOp<1, TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >,
int>’
batch.ii:128:8: required from ‘struct TensorEvaluator<TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, int>’
batch.ii:93:41: required from ‘struct
TensorContractionEvaluatorBase<TensorEvaluator<const
TensorContractionOp<array<int, 1>, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, int>, int> >’
batch.ii:99:8: required from ‘struct TensorEvaluator<const
TensorContractionOp<array<int, 1>, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, int>, int>’
batch.ii:148:41: required from ‘struct TensorEvaluator<const
TensorAssignOp<TensorChippingOp<0, const TensorMap<Trans_NS_Eigen_Tensor<int,
3, 1, int>, 1> >, const TensorContractionOp<array<int, 1>, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, TensorChippingOp<1,
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0> >, int> >, int>’
batch.ii:165:5: required from here
batch.ii:123:20: error: invalid use of incomplete type ‘class
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0>’
123 | static const int NumInputDims = H<typename
ArgType::Dimensions>::value;
| ^~~~~~~~~~~~
batch.ii:18:60: note: declaration of ‘class
TensorMap<Trans_NS_Eigen_Tensor<int, 3, 0, int>, 0>’
18 | template <typename, int, template <class> class = B> class TensorMap;
| ^~~~~~~~~
batch.ii: In lambda function:
batch.ii:246:54: warning: no return statement in function returning non-void
[-Wreturn-type]
246 | I registrar__body__1__object([](int *) -> A * { K(); });
| ^
with a compiler configure with:
../configure --enable-languages=c,c++,lto,fortran --disable-multilib
--prefix=/home/marxin/bin/gcc2 --disable-bootstrap --without-isl
--disable-libsanitizer
and
$ g++ batch.ii -c -fchecking
batch.ii: In lambda function:
batch.ii:246:54: warning: no return statement in function returning non-void
[-Wreturn-type]
246 | I registrar__body__1__object([](int *) -> A * { K(); });
|
with:
../configure --enable-languages=c,c++,lto,fortran --disable-multilib
--prefix=/home/marxin/bin/gcc2 --disable-bootstrap --without-isl
--disable-libsanitizer --enable-checking=release