Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Liu__Bensong
Beginner
105 Views

IntelC++ failed to compile thread_local extern std::stringstream::str(std::string) correctly

I got a `segmentation fault` after compiling code below with icpc. However, clang++ and g++ compile it correctly.

// bug.cc
#include <sstream>
#include <string>

thread_local extern std::stringstream foo;

int main() {
    foo.str(std::string());
    return 0;
}
// lib.cc
#include <sstream>
thread_local std::stringstream foo;

Here's a screenshot while I'm reproducing the problem.

screenshot on error

Source files and the log is attached. My OS is latest ArchLinux, and other OS information is shown on the screenshot.

0 Kudos
1 Reply
Viet_H_Intel
Moderator
105 Views

Intel compiler version 18.0 doesn't support GCC 8.1. If you compile the test program on the system which had GCC 4.3 to 6.3 installed, then it should work.

Thanks,

Viet

Reply