Some gcc Headers will not Compile due to Use of C++0x Variadic Templates


Reference Number : DPD200027211


Version : 11.1, Intel® C++ Compiler XE 2011


Product : Intel® C++ Composer XE for Linux*, Intel® C++ Compiler for Linux* Professional Edition


Operating System : Linux*


Problem Description : From gcc 4.3 forward, certain gcc header files contain uses of the C++0x feature variadic templates.  This feature is not yet supported by the Intel® C++ Compiler, so the use of the feature in these header files causes compilation errors with the Intel compiler.  The following is a table of header files and the gcc versions where these header files have issues.

gcc 4.3gcc 4.4gcc 4.5
tuplefailsfailsfails
threadfailsfails
mutexfailsfails
type_traitspassesfailsfails
functionalpassespassesfails
futurefails

† Header file does not exist in this version of gcc

An example of an error you might see is:

[shell:nogutter:nocontrols]error: function is not a template[/shell:nogutter:nocontrols]

Resolution Status : These issues has been resolved in the Intel® C++ Composer XE 2011 Update 6.  Note that using update 6 is a significant compiler upgrade from previous updates.

[DISCLAIMER: The information on this web site is intended for hardware system manufacturers and software developers. Intel does not warrant the accuracy, completeness or utility of any information on this site. Intel may make changes to the information or the site at any time without notice. Intel makes no commitment to update the information at this site. ALL INFORMATION PROVIDED ON THIS WEBSITE IS PROVIDED "as is" without any express, implied, or statutory warranty of any kind including but not limited to warranties of merchantability, non-infringement of intellectual property, or fitness for any particular purpose. Independent companies manufacture the third-party products that are mentioned on this site. Intel is not responsible for the quality or performance of third-party products and makes no representation or warranty regarding such products. The third-party supplier remains solely responsible for the design, manufacture, sale and functionality of its products. Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries. *Other names and brands may be claimed as the property of others.]
For more complete information about compiler optimizations, see our Optimization Notice.

4 comments

Top
Sergey Kostrov's picture

That's a very interesting to learn.

But, to be honest, I will resist to ANY attempt of using 'variadic templates' on our 95%-C++-templates-based project. Why? Because of portability issues with some older C/C++ compilers currently used on the project.

Best regards,
Sergey

Brandon Hewitt (Intel)'s picture

Hi Dave,

Unfortunately I can't comment on future product plans, but we are taking this compatibility problem seriously and are working on a fix.

davehomiak's picture

Forgot to point out in my first post that this error is in my code, not a gcc header, and a variadic template is not involved.

davehomiak's picture

What is the status of this issue. I am evaluating icpc (ICC) 12.0.4 20110427, and see that the following bug was fixed:

DPD200165009 C++ gcc* 4.5 error: GNU C++ allows C++0x list initializers in non-C++0x modes

but I am still getting errors using gcc 4.5.1 headers like this:

error: hash is not a template
struct hash<test::math::framework::PriceDouble>

so, it fits the description mentioned above. Can you give any estimate of when this will be fixed?

Thanks.

Add a Comment

Have a technical question? Visit our forums. Have site or software product issues? Contact support.