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

/permissive- switch on Windows ( 2018 Update 3)

AndrewC
New Contributor III
533 Views

Setting /permissive- switch on Windows causes some problems.

The code below compiles using the Microsoft Compiler Visual C++ 2017 15.8.2 both with AND without "/permissive-"

However the code fails to compile using Intel Compiler 2018 Update 3 with "/permissive-"

I have encountered many other issues when "/permissive-" is set when using the Intel Compiler.

 

error : identifier "silly" is undefined
1>      silly tmp = something;
1>      ^
1>          detected during instantiation of class "CDataCacheGetFn<T1, T2, T3> [with T1=double, T2=silly, T3=double]" at line 33
1>
error : expected a ";"
1>      silly tmp = something;
1>            ^
1>          detected during instantiation of class "CDataCacheGetFn<T1, T2, T3> [with T1=double, T2=silly, T3=double]" at line 33

template <class T1, class T2, class T3>
class CDataCacheGetFn
{
public:
	T1 GetFn(const T2 &t2, const T3& t3, void *data)const;
};
struct silly
{

};
double CDataCacheGetFn<double, silly, double>::GetFn(const   silly &something, const double &f, void *)const
{
	silly tmp = something;
	return 1.0;
}

 

0 Kudos
3 Replies
Viet_H_Intel
Moderator
533 Views

Hi,

Latest supported by Intel® C++ Compiler 18.0 Update 3 version of Microsoft Visual Studio 2017* is 15.6. Please use the supported version of Visual Studio and let us know if the problem still occurs.

Thanks,

Viet

0 Kudos
AndrewC
New Contributor III
533 Views

I realized that the explicit instantiation of the function needs a template<>  in front.

With that in place, there are no compiler errors from ICC

It's hard to avoid upgrading Visual Studio, and apart from this behavior  I have no other issues using 2018 Update 3 with Visual Studio 15.8.

/permissive- was introduced in Visual Studio 2017 15.3 as per

https://blogs.msdn.microsoft.com/vcblog/2017/09/11/two-phase-name-lookup-support-comes-to-msvc/

Clearly ICC is taking notice of the /permissive- switch.

 

0 Kudos
AndrewC
New Contributor III
533 Views

I would point out that clang returned a sensible error message. The error message from ICC was quite bizarre.

 

main.cpp:13:8: error: specializing member ‘CDataCacheGetFn<double, silly, double>::GetFn’ requires ‘template<>’ syntax double CDataCacheGetFn<double, silly, double>::GetFn(const silly &something, const double &f, void *)const

0 Kudos
Reply