Eigen::Array of void* breaks compilation on VS2015

Submitted by sim..@..um.com

Assigned to Nobody

Link to original bugzilla bug (#1440)
Version: 3.3 (current stable)
Operating system: Windows

Description

Hi,

The following code

Eigen::Array< void*, 64, 1 > handles;         // Reason for compilation failure  

Eigen::Matrix< double, 3, 1 > p0(1, 2, 3);  
Eigen::Matrix< double, 3, 1 > p1(3, 2, 1);  
Eigen::Matrix< double, 3, 1 > e = p0 - p1;    // Compilation fails here  

fails to compile the last line with MSVC2015 Update 3 and eigen versions 3.3.3 and 3.3.4, while it works with eigen 3.2.8. gcc is fine with either version of eigen. Commenting the first line makes the problem disappear, using Eigen::Array< int*, ...> as well. The compiler reports as follows:

3.3.4\eigen\src\core\util\meta.h(137): error C2182: 'abstract declarator': illegal use of type 'void'
1> eigen-3.3.4\eigen\src\core\util\meta.h(156): note: see reference to class template instantiation 'Eigen::internal::is_convertible_impl<Eigen::Matrix<double,3,1,0,3,1>,void>' being compiled
1> eigen-3.3.4\eigen\src\core\util\xprhelper.h(64): note: see reference to class template instantiation 'Eigen::internal::is_convertible<T,PromotedType>' being compiled
1> with
1> [
1> T=Eigen::Matrix<double,3,1,0,3,1>,
1> PromotedType=void *
1> ]
1> eigentester\eigentester\main.cpp(13): note: see reference to class template instantiation 'Eigen::internal::promote_scalar_arg<void *,Eigen::Matrix<double,3,1,0,3,1>,false>' being compiled

I'm aware that an Eigen::Array< void*, ... > is not a major use case. However, as the expression failing to compile has no obvious link to the source of the problem, I wanted to have this documented in case someone else is running into this.

best, Simon

Edited by Eigen Bugzilla