Compiler error in alloc_traits.h from GCC 4.9

Compiler error in alloc_traits.h from GCC 4.9

Hey there,

ICC 14.0 fails to compile most of STL code as shipped by GCC 4.9:

$ cat test.cpp 
#include <vector>
int main() { return 0; }


$ icpc -std=c++11 test.cpp 
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
/usr/include/c++/4.9.0/bits/alloc_traits.h(248): error: expected a ">"
          = typename __construct_helper<_Tp, _Args...>::type;
                                                  ^
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
          detected during instantiation of type "std::allocator_traits<_Alloc>::__has_construct<_Tp, _Args...>" at line 251
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):

In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
/usr/include/c++/4.9.0/type_traits(115): error: not a class or struct name
      : public _B1
               ^
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
          detected during:
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
            instantiation of class "std::__and_<_B1> [with _B1=<error-type>]" at line 1907
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
            instantiation of type "std::_Require<<error-type>>" at line 251 of "/usr/include/c++/4.9.0/bits/alloc_traits.h"
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):

In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
/usr/include/c++/4.9.0/type_traits(1907): error: class "std::__and_<<error-type>>" has no member "value"
      using _Require = typename enable_if<__and_<_Cond...>::value>::type;
                                                            ^
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
          detected during instantiation of type "std::_Require<<error-type>>" at line 251 of "/usr/include/c++/4.9.0/bits/alloc_traits.h"
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):

In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
/usr/include/c++/4.9.0/type_traits(1907): error: class "std::enable_if<<error-constant>, void>" has no member "type"
      using _Require = typename enable_if<__and_<_Cond...>::value>::type;
                                                                    ^
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):
          detected during instantiation of type "std::_Require<<error-type>>" at line 251 of "/usr/include/c++/4.9.0/bits/alloc_traits.h"
In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_construct.h(61),
                 from /usr/include/c++/4.9.0/vector(62),
                 from test.cpp(1):

compilation aborted for test.cpp (code 2)

Will a new icpc be released to fix this?

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi,

    Intel compiler version 14.0 is still not supporting GCC version 4.9, Could you try using GCC version 4.8?

Regards,

Sukruth H V

Yes, I see that ICPC 14 is not working with GCC 4.9 :)

What I want to know is whether ICPC 15 will support it. And if it does, is there and ETA for it?

The beta compiler announced at the top of the forum works OK with my examples of g++ 4.9 STL.

Traditionally, a compiler similar to beta is released about 6 months later.

I just downloaded the beta version of icc and it still cannot compile my code:

icc (ICC) 15.0.0 20140428

 

In file included from /usr/include/c++/4.9.0/ext/alloc_traits.h(36),
                 from /usr/include/c++/4.9.0/bits/stl_tree.h(65),
                 from /usr/include/c++/4.9.0/map(60),
                 ...
/usr/include/c++/4.9.0/bits/alloc_traits.h(248): error: expected a ">"
          = typename __construct_helper<_Tp, _Args...>::type;

I cannot, nor want to, downgrade GCC. So what can I do now? Do I have to compile an older GCC myself and then use -cxxlib=... to use that?

 

This was our DPD200253403 which was fixed in 15.0 on 5/12 so it should be fixed in the next 15.0 beta (beta update 2) which is due out soon.

Sorry for the inconvenience.

Judy

 

Leave a Comment

Please sign in to add a comment. Not a member? Join today