Hi,
I have this build failure:
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Apple LLVM version 4.2 (clang-425.0.24) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.2.1
Thread model: posix
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/cv/tw4r4vx93vl4dtdtl_5869g00000gp/T/UriDispatcherLibTests-Za5OKO.mm
clang: note: diagnostic msg: /var/folders/cv/tw4r4vx93vl4dtdtl_5869g00000gp/T/UriDispatcherLibTests-Za5OKO.sh
clang: note: diagnostic msg:
********************
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254
Which looks like a hard clang crash. Can somebody try to reproduce that crash? Here is a reduction source code (objective-C++ code):
std::string NSString2String(NSString *from)
{
const char *cfrom = [from UTF8String];
std::string result(cfrom);
return result;
}
void NSDictionary2stringMap(NSDictionary *from, std::map<std::string,std::string>* to)
{
for (auto item:from) { // replace auto with id, to stop clang from crashing
std::string key = NSString2String(item);
std::string value = NSString2String(from[item]);
(*to)[key] = value;
}
}
The "auto" type declaration that crashes clang is a new C++11 feature, but clang seems to crash when compiling for C++98 too (instead of reporting an error).
So is this some gremlin in my machine or some actual clang bug?