This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 853 - MSVC 2013 generates an error with "Traits::template match<Derived>::MatchAtCompileTime" in src/Core/Ref.h
Summary: MSVC 2013 generates an error with "Traits::template match<Derived>::MatchAtCo...
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All Windows
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords: Compatibility
Depends on:
Blocks:
 
Reported: 2014-08-11 16:43 UTC by Kenshi Takayama
Modified: 2019-12-04 13:34 UTC (History)
3 users (show)



Attachments

Description Kenshi Takayama 2014-08-11 16:43:56 UTC
MSVC 2013 produces errors with the following code:

--------------------------

#include <Eigen/Sparse>
using namespace Eigen;
int main() {
    SparseMatrix<double> m;
    SparseLU<decltype(m)> lu;
    lu.compute(m);
}

--------------------------

Errors occur where this expression "Traits::template match<Derived>::MatchAtCompileTime" appears in src/Core/Ref.h. The errors go away when that expression is replaced by "Traits::match<Derived>::MatchAtCompileTime". I'm not sure if MSVC is violating the Standard, but I'd appreciate greatly if this issue is taken care of in the Eigen codebase.

Best,
Kenshi
Comment 1 Gael Guennebaud 2014-08-21 09:45:49 UTC
MSVC is indeed violating the standard here, and removing the template keyword makes all other compilers fail to compile. Have you installed all updates?

Could someone else confirm this issue?
Comment 2 Christoph Hertzberg 2014-11-03 15:55:59 UTC
Can we hide the enable_if construct somehow in an internal function (cf Bug 903), or couldn't we actually use a static assert here?
Comment 3 Gael Guennebaud 2014-11-05 16:17:49 UTC
Hopefully this is enough to workaround MSVC weirdness. Feel free to reopen if that's still broken.

https://bitbucket.org/eigen/eigen/commits/06d4fff20a93/
Changeset:   06d4fff20a93
User:        ggael
Date:        2014-11-05 15:15:17+00:00
Summary:     Big 853: replace enable_if in Ref<> ctor by static assertions and add failtests for Ref<>
Comment 4 Nobody 2019-12-04 13:34:20 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/853.

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