Intel® C++ Compiler
Support and discussions for creating C++ code that runs on platforms based on Intel® processors.
7646 Discussions

Bug with std::stringstream inside a lambda and #pragma optimize("", off)

User87135761
Beginner
334 Views

Hi, it looks like I came across a compiler bug.

The following example seg faults on intel c++ 2018.5.274 on Linux:

#pragma optimize(""off) // it doesn't crash without this line
#include <sstream>

int main() {
    [] { std::stringstream{}; }();
}
 
compile with: icc -o main main.cpp
Using CentOS7
0 Kudos
4 Replies
User87135761
Beginner
328 Views

I forgot to mention that it happens on Linux (CentOS7) but not on Windows 10.

I edited my post.

Gopika_Intel
Moderator
301 Views

Hi,

Thank you for reaching out. We were able to reproduce the issue. We’re looking into it and will get back to you.

Regards

Gopika


Viet_H_Intel
Moderator
86 Views

Not sure if you already knew, but Intel Classic Compiler will enter "Legacy Product Support" mode, signaling the end of regular updates. Please refer to the article bellow for more details.

https://www.intel.com/content/www/us/en/developer/articles/technical/adoption-of-llvm-complete-icx.h...


For that reason, Developer isn't plan to to fix this in Classic compiler. Can you migrate to icx/icpx? and let us know if we could close this case?


Thanks,

Viet


Viet_H_Intel
Moderator
74 Views

Please migrate to icx. We are going to close this as won't fix in C++ Classic compiler. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel. 


Thanks,



Reply