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

icc 15.0.3 cannot compile std::vector<double> constructor with headers from gcc 5.1.1

Bradley_K_
New Contributor I
996 Views

The following simple program doesn't compile with icc 15.0.3 on Fedora 22.  It does work on Fedora 20.  I think the main difference is that Fedora 22 is using gcc 5.1.1, which is where the header files come from.  In contrast Fedora 20 uses gcc 4.8.3.

 

I don't know how to interpret the error message.

-Bradley

$ cat ipc.cc
#include <vector>

void foo(int n) {
    std::vector<double> V(n, 1);
}
$ icc -std=c++11   -c -o ipc.o ipc.cc
/usr/include/c++/5.1.1/bits/stl_iterator_base_types.h(154): error: name followed by "::" must be a class or namespace name
        typedef typename _Iterator::iterator_category iterator_category;
                         ^
          detected during:
            instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163
            instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 4 of "ipc.cc"

/usr/include/c++/5.1.1/bits/stl_iterator_base_types.h(155): error: name followed by "::" must be a class or namespace name
        typedef typename _Iterator::value_type        value_type;
                         ^
          detected during:
            instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163
            instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 4 of "ipc.cc"

/usr/include/c++/5.1.1/bits/stl_iterator_base_types.h(156): error: name followed by "::" must be a class or namespace name
        typedef typename _Iterator::difference_type   difference_type;
                         ^
          detected during:
            instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163
            instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 4 of "ipc.cc"

/usr/include/c++/5.1.1/bits/stl_iterator_base_types.h(157): error: name followed by "::" must be a class or namespace name
        typedef typename _Iterator::pointer           pointer;
                         ^
          detected during:
            instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163
            instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 4 of "ipc.cc"

/usr/include/c++/5.1.1/bits/stl_iterator_base_types.h(158): error: name followed by "::" must be a class or namespace name
        typedef typename _Iterator::reference         reference;
                         ^
          detected during:
            instantiation of class "std::__iterator_traits<_Iterator, void> [with _Iterator=int]" at line 163
            instantiation of class "std::iterator_traits<_Iterator> [with _Iterator=int]" at line 4 of "ipc.cc"

compilation aborted for ipc.cc (code 2)
$

0 Kudos
10 Replies
Judith_W_Intel
Employee
996 Views

 

We are aware of this problem and have been tracking it in our bugs database as DPD200365668.

The header file problem is because GNU 5.0 implemented the resolution of Core Issue 1558 described here:

http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#1558

This is proving very difficult to implement in our front end but it is currently our number one priority.

Sorry for the inconvenience. Earlier versions of GNU (which obviously don't rely on this fix) should work fine.

Judy

0 Kudos
KitturGanesh
Employee
996 Views

Thanks Judy, I'll update this thread as soon as the release with the fix is available, appreciate much.

_Kittur 

0 Kudos
Nicholas_S_Intel
Employee
996 Views

Any update on this bug?

0 Kudos
Bradley_K_
New Contributor I
996 Views

This bug appears to still be present in 16.0.0 and in 16.0.1.

 

0 Kudos
KitturGanesh
Employee
996 Views

Hi Nicholas/Bradley,
Yes, this is our number 1 priority and the issue has been filed with the product team and are aware of it and the delay is due to a third-party dependency. As soon as a release with the fix is out, I'll update you accordingly. In the meantime, there is a workaround for the most common cases of the problem  as described below. If the code can be changed to avoid the need for the forwarding “trick” from the STL overloads that take two iterator ranges by ensuring that the two arguments types do not exactly match each other that would workaround the problem.

For example:
#include <vector>
void foo(int n) {
#ifdef OK

    std::vector<double> V(n, 1.0); // this will work because the type of the first argument is int and the type of the second argument is double
#else
   std::vector<double> V(n, 1);

#endif
}

Hope the above helps, else there's no other solution other than awaiting for the release with the fix. Again, appreciate your patience through this.
_Kittur

0 Kudos
Hoste__Kenneth
Beginner
996 Views

Can someone confirm that this issue resolved is the 2016.2.181 release of the Intel compilers?

0 Kudos
Hoste__Kenneth
Beginner
996 Views

https://software.intel.com/en-us/articles/intel-parallel-studio-xe-2016-composer-edition-compilers-fixes-list includes a pointer to this problem (DPD200365668) marking it as fixed in the 2016.2.181 release

0 Kudos
KitturGanesh
Employee
996 Views

@kehoste:
Hi, yes, this is fixed in  the latest update 2 release that's out which you can download from the Intel Registration Center. Appreciate if you can confirm as well. Thanks for your patience through this issue.
_Kittur

0 Kudos
Declan__V_
Beginner
996 Views

Hi,

I just thought I would confirm that the above mentioned fix (Update 2 release) fixes the same problem I was experiencing.

Thanks

0 Kudos
KitturGanesh
Employee
996 Views

@Declan:  Thanks much, I assume you're confirming as well that it's fixed in update 2, correct? If so, appreciate much and for your patience through this.
_Regards,
Kittur

0 Kudos
Reply