Hi
The following program fails with " double free or corruption" error. I believe it is a compiler bug. Could someone please have a look at it.
icpc version 14.0.1 (gcc version 4.7.0 compatibility)
icpc -std=c++11 -O2 -g streamtest.cpp
#include <iostream> #include <stdio.h> #include <sstream> struct Path { Path() { _host = "host"; _dir = "dir"; _file = "file"; } std::string host() { return _host; } std::string path() { std::string ret = host() + _dir + _file; return ret; } private: std::string _dir; std::string _file; std::string _host; }; int main () { Path path; std::string p = path.path(); return 0;
}