Compilation Error: Unnecessary Template declaration in TensorStorage
Submitted by neu..@..eck.de
Assigned to Nobody
Link to original bugzilla bug (#1459)
Version: 3.3 (current stable)
Description
Error Message using clang-cl (v 5.0.0) (works fine with vs151)
3>C:\Sources\Extern\vcpkg\installed\x64-windows\include\unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h(39,7): error : class template partial specialization is not more specialized than the primary template [-Winvalid-partial-specialization]
3>class TensorStorage<T, FixedDimensions, Options_>
3> ^
3>C:\Sources\Extern\vcpkg\installed\x64-windows\include\unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h(34,63): note: template is declared here
3>template<typename T, typename Dimensions, int Options_> class TensorStorage;
Offending code:
template<typename T, typename Dimensions, int Options_> class TensorStorage;
// Pure fixed-size storage
template<typename T, int Options_, typename FixedDimensions>
class TensorStorage<T, FixedDimensions, Options_>
{ <insert some code here> };
Reason:
newer clang version seems smart enough to deduce that both templates are basically the same.
Solution:
Remove the unnesscary template and reordner template parameters of the second one.
template<typename T, typename FixedDimensions, int Options_>
class TensorStorage
{ <insert some code here> };
Alternative:
Add one more template parameter and declare it void
template<typename T, typename Dimensions, int Options_, typename empty = void> class TensorStorage;