This bugzilla service is closed. All entries have been migrated to
Bug 1459 - Compilation Error: Unnecessary Template declaration in TensorStorage
Summary: Compilation Error: Unnecessary Template declaration in TensorStorage
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Tensor (show other bugs)
Version: 3.3 (current stable)
Hardware: All Other
: Normal Compilation Problem
Assignee: Nobody
Depends on:
Reported: 2017-08-08 20:28 UTC by neumann
Modified: 2019-12-04 17:09 UTC (History)
4 users (show)


Description neumann 2017-08-08 20:28:12 UTC
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> };

newer clang version seems smart enough to deduce that both templates are basically the same.

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> };

Add one more template parameter and declare it void 
template<typename T, typename Dimensions, int Options_, typename empty = void> class TensorStorage;
Comment 1 Nobody 2019-12-04 17:09:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.