Community
cancel
Showing results for 
Search instead for 
Did you mean: 
x_x_
Beginner
65 Views

decltype issue in 15.0

Jump to solution

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
65 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

2 Replies
Hubert_H_Intel
Employee
65 Views

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

Regards, Hubert.

Hubert_H_Intel
Employee
66 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

Reply