Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
8 Views

Type deduction failure with a class template explicitly specialised with a user defined type

Hi,

I am trying to recompile a simulation program using icl to take advantage or Intel's mkl library, however, I have discovered a potential bug with the icl compiler.

I have a class template which is explicitly specialised with a user defined type (a struct of parameters which will be different for different distributions).

I have attached a stripped down version of my code ('get_type.cpp') which reproduces the error.

I am using the 2017 icl compiler on Windows 7 SP1 x-64 and Visual Studio 2015 Update 3. I am launching icl via the 'Intel 64' command prompt short cut.

I am using the commands:

icl /EHsc /Wall /Qstd=c++14 /O3 get_type.cpp

The message I am getting is:

get_type.cpp
get_type.cpp(44): error: no suitable conversion function from "const Normal" to "double" exists
              nreps_ {nreps}, nobs_ {nobs}, ar_ {ar}, dist_ {dist}, results_ {}
                                                             ^

For reference, both clang++ and Microsoft compilers compile and generate the following output.

clang++:

What type is Normal?
6Normal

Now the class SimTest<Normal>...
Deducing types for the private members...

nreps is: y
nobs is: y
ar is: d
dist is: 6Normal
results is: St6vectorIdSaIdEE

Now the copy of class SimTest<Normal>...
Deducing types for the private members...

nreps is: y
nobs is: y
ar is: d
dist is: 6Normal
results is: St6vectorIdSaIdEE

Microsoft cl:

What type is Normal?
struct Normal

Now the class SimTest<Normal>...
Deducing types for the private members...

nreps is: unsigned __int64
nobs is: unsigned __int64
ar is: double
dist is: struct Normal
results is: class std::vector<double,class std::allocator<double> >

Now the copy of class SimTest<Normal>...
Deducing types for the private members...

nreps is: unsigned __int64
nobs is: unsigned __int64
ar is: double
dist is: struct Normal
results is: class std::vector<double,class std::allocator<double> >


Thanks,
Luke

0 Kudos
1 Reply
Highlighted
Employee
8 Views

Hi, Luke

I'm closing this one as it is duplicate with another thread:

https://software.intel.com/en-us/forums/intel-c-compiler/topic/697034

Thanks.

0 Kudos