- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
#include <vector>
template <typename T>
class C
{
public :
void call ()
{
std::vector<double> data(100);
}
};
int main ()
{
C<double> c;
c.call();
}
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
emplace_back(_Args&&... __args);
^
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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there any estimate for when this update will be release?
Is there a workaround by using some other C++11-enabled standard library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm hitting this bug as well. It would be really nice to have an ETA for the fix or at least some kind of workaround.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hopefully icpc will now be fully compatible with g++ >= 4.7 headers in C++-11 mode, this is getting really tiring...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page