I have recently installed the icpc 14, the newest version. I tried to use it in C++11 mode with GCC 4.7 (4.7.2 and 4.7.3 tested). A strange error when constructing std::vector happens. I managed to reduce it to the following minimal example,
template <typename T>
void call ()
int main ()
When compiled with
icpc -std=c++11 -o test test.cpp # possible -gcc-name etc option to choose GCC versions
An error as the following is output,
/opt/gcc/include/c++/4.7.2/bits/stl_vector.h(904): internal error: bad pointer
compilation aborted for test.cpp (code 4)
If I just define such a vector in a free function, it is fine. If I remove the template, make the class C a simple class, it is fine. However, in the above example the error occurs with GCC 4.7.2 and GCC 4.7.3. I haven't got a chance to test with other GCC versions.
I see the same thing with g++-4.9, although g++ by itself succeeds. Strangely, icpc dislikes the header file only when the c++-11 section is enabled.
With the previous release (13.1.192) it also is necessary to remove the c++11 option to make it pass. There are many more errors under -std=c++-11.
Naming an a.out as test is generally dangerous, but that's not the problem here. It's definitely a reportable bug, but I've been locked out of the bug reporting system for 3 weeks now.
Sergey Kostrov wrote:
This is simply to note that vector class is a fundamental in STL library and it is not clear how it could be related to the latest C++11 Standard. The only explanation could be It is the Bug in the compiler.
Surely it has something to do with C++11. If you look at the error message, it has something to do with rvalue reference. And the constructor in the minimal example is actually different in C++98 and C++11
I have just also hit this problem when using a std::multimap, this apparently can also trigger this bug indirectly.
Is there by now any estimate on when the fix will be released, or at least any workaround for the meantime?
This was fixed and should be in 14.0 update 1 (which should be available very soon since it passed product validation a few days ago).
Sorry for the inconvenience.