Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
Om Sachan (Intel)
Total Points:
4,920
Status Points:
4,420
Brown Belt
November 26, 2008 9:01 PM PST
Intel C++ compiler gave an error message for each of the following pure virtual template functions which have compiled successfully on both VC 2003 and VC 2005.

I just downloaded the beta version of Parallel Composer for Windows which includes the Intel C++ compiler. I substituted the Intel compiler for the VC 2005 C++ compiler on an existing project. The Intel C++ compiler gave an error message for each of the following pure virtual template functions which have compiled successfully on both VC 2003 and VC 2005.

template<class T1>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&) = 0;

template<class T1, class T2>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&) = 0;

template<class T1, class T2, class T3>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&) = 0;

template<class T1, class T2, class T3, class T4>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5, class T6>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&, T6&) = 0;

Please let me know if you have a work around.

Om Sachan (Intel)
Total Points:
4,920
Status Points:
4,420
Brown Belt
November 26, 2008 9:07 PM PST
Rate
 
#1

I just downloaded the beta version of Parallel Composer for Windows which includes the Intel C++ compiler. I substituted the Intel compiler for the VC 2005 C++ compiler on an existing project. The Intel C++ compiler gave an error message for each of the following pure virtual template functions which have compiled successfully on both VC 2003 and VC 2005.

template<class T1>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&) = 0;

template<class T1, class T2>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&) = 0;

template<class T1, class T2, class T3>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&) = 0;

template<class T1, class T2, class T3, class T4>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5, class T6>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&, T6&) = 0;

Please let me know if you have a work around.

I could not compile the code segments with Microsoft compiler (Visual Studio 2005). Could you please provide the code segmet  that compiler cleanly with microsoft compiler and failed to compiler with Intel C++ compiler? 



jackblevinsassistantsoftwar...
Total Points:
90
Status Points:
40
Green Belt
November 27, 2008 6:20 PM PST
Rate
 
#2

I just downloaded the beta version of Parallel Composer for Windows which includes the Intel C++ compiler. I substituted the Intel compiler for the VC 2005 C++ compiler on an existing project. The Intel C++ compiler gave an error message for each of the following pure virtual template functions which have compiled successfully on both VC 2003 and VC 2005.

template<class T1>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&) = 0;

template<class T1, class T2>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&) = 0;

template<class T1, class T2, class T3>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&) = 0;

template<class T1, class T2, class T3, class T4>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&) = 0;

 

template<class T1, class T2, class T3, class T4, class T5, class T6>

ProcessingStatusCode::ProcessingStatusCodes ProcessorCall(unsigned int function, T1&, T2&, T3&, T4&, T5&, T6&) = 0;

Please let me know if you have a work around.

 



jackblevinsassistantsoftwar...
Total Points:
90
Status Points:
40
Green Belt
November 27, 2008 6:32 PM PST
Rate
 
#3 Reply to #1

I could not compile the code segments with Microsoft compiler (Visual Studio 2005). Could you please provide the code segmet  that compiler cleanly with microsoft compiler and failed to compiler with Intel C++ compiler? 

I have created a simple MFC project which will give the error. See TPVF.zip.

Jack Blevins

 



Om Sachan (Intel)
Total Points:
4,920
Status Points:
4,420
Brown Belt
January 4, 2009 9:59 PM PST
Rate
 
#5 Reply to #4
Dear sir,
You forgot to attach the testcase/project. Could you please attach it using "Add File" tab or you can email it to me, om.p.sachan@intel.com?
Thanks,
Om

 

 

It makes no sense to put a pure virtual specifier on a non virtual function and template functions cannot be virtual so this code is clearly incorrect. If you try to actually call the function (i.e. instantiate it) then Microsoft will give an error also.

 

// pure virtual test case

// tst_pureVirtual.cpp

 

struct C

{

  template<class T> void foo() = 0;

};

 

int main() {

  C c;

  c.foo<int>(); // MS gives error on the instantiation

  return 0;

}

 

----------------------------------------------

C:\ >cl -c tst_pureVirtual.cpp

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42 for 80x86

Copyright (C) Microsoft Corporation.  All rights reserved.

 

tst_pureVirtual.cpp

tst_pureVirtual.cpp(5) : error C2059: syntax error : '='

      tst_pureVirtual.cpp(10) : see reference to function template instantiation 'void C::foo<int>(void)' being compiled

 





Intel Software Network Forums Statistics

6668 users have contributed to 28284 threads and 87462 posts to date.
In the past 24 hours, we have 5 new thread(s) 34 new posts(s), and 46 new user(s).

In the past 3 days, the most popular thread for everyone has been Fortran and Matlab The most posts were made to Larger Test Data The post with the most views is Quoting - nabeels Hello e

Please welcome our newest member karolbe