mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-02-05 17:50:26 +08:00
Fixed a few compilation warnings
This commit is contained in:
parent
3f1ee45833
commit
6720b38fbf
@ -41,7 +41,10 @@ class TensorStorage<T, FixedDimensions, Options_>
|
||||
private:
|
||||
static const std::size_t Size = FixedDimensions::total_size;
|
||||
|
||||
EIGEN_ALIGN_MAX T m_data[Size];
|
||||
// Allocate an array of size at least one to prevent compiler warnings.
|
||||
static const std::size_t MinSize = max_n_1<Size>::size;
|
||||
EIGEN_ALIGN_MAX T m_data[MinSize];
|
||||
|
||||
FixedDimensions m_dimensions;
|
||||
|
||||
public:
|
||||
|
@ -16,16 +16,20 @@ static void test_empty_tensor()
|
||||
{
|
||||
Tensor<float, 2> source;
|
||||
Tensor<float, 2> tgt1 = source;
|
||||
Tensor<float, 2> tgt2;
|
||||
tgt2 = source;
|
||||
Tensor<float, 2> tgt2(source);
|
||||
Tensor<float, 2> tgt3;
|
||||
tgt3 = tgt1;
|
||||
tgt3 = tgt2;
|
||||
}
|
||||
|
||||
static void test_empty_fixed_size_tensor()
|
||||
{
|
||||
TensorFixedSize<float, Sizes<0>> source;
|
||||
TensorFixedSize<float, Sizes<0>> tgt1 = source;
|
||||
TensorFixedSize<float, Sizes<0>> tgt2;
|
||||
tgt2 = source;
|
||||
TensorFixedSize<float, Sizes<0>> tgt2(source);
|
||||
TensorFixedSize<float, Sizes<0>> tgt3;
|
||||
tgt3 = tgt1;
|
||||
tgt3 = tgt2;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user