Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

decltype issue in 15.0

x_x_
Beginner
373 Views

The following code generates an error:

template<typename T>
class A
{
    static T m;
};

template<typename T>
decltype(A<T>::m) A<T>::m;


The error message is: declaration is incompatible with "T A<T>::m" (declared at line 4)

I use MSVC2013 and the "v120" base platform toolset.

The code works with both Microsoft compiler versions (v120 and CTP_Nov2013).

I'm wondering if this is just a Microsoft extension or if there's a bug in your compiler.

0 Kudos
1 Solution
Hubert_H_Intel
Employee
373 Views

It seems to me to be a compatibiliy bug in the Intel Compiler and I'm going to file a bug reqport. The Microsoft compiler is correct.

Regards, Hubert.

View solution in original post

0 Kudos
2 Replies
Hubert_H_Intel
Employee
373 Views

Your observation is right. The Intel compilers fails compiling the code. I'll check.

Regards, Hubert.

0 Kudos
Hubert_H_Intel
Employee
374 Views

It seems to me to be a compatibiliy bug in the Intel Compiler and I'm going to file a bug reqport. The Microsoft compiler is correct.

Regards, Hubert.

0 Kudos
Reply