FS#47329 - [clang] crashes when compile with -std=c++11 -stdlib=libc++
Attached to Project:
Arch Linux
Opened by Weitian Leung (timxx) - Friday, 11 December 2015, 07:01 GMT
Last edited by Evangelos Foutras (foutrelis) - Friday, 15 January 2016, 19:56 GMT
Opened by Weitian Leung (timxx) - Friday, 11 December 2015, 07:01 GMT
Last edited by Evangelos Foutras (foutrelis) - Friday, 15 January 2016, 19:56 GMT
|
Details
Description:
After the latest update (3.7.0-6), clang failes compile a simple program like hello world: #include <iostream> int main() { std::cout << "Hello, world" << std::endl; return 0; } compile with: clang++ -c helloworld.cpp -std=c++11 -stdlib=libc++ It works when remove -std=c++11 or -stdlib=libc++. Check the attachment for the crashes infomation. Additional info: * package version(s) clang 3.7.0-6 * config and/or log files etc. Steps to reproduce: Show as Description |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Friday, 15 January 2016, 19:56 GMT
Reason for closing: Fixed
Additional comments about closing: clang 3.7.1-1
Friday, 15 January 2016, 19:56 GMT
Reason for closing: Fixed
Additional comments about closing: clang 3.7.1-1
I reported more details in a separate bug (https://bugs.archlinux.org/task/47375 ), which was closed as a duplicate of the present bug.
EDIT: Ah, the "hello world" program does indeed crash once I do `sudo pacman -S libc++`. Before that it just failed to compile with the `-stdlib=libc++` option.
AbiTagState::write (ItaniumMangle.cpp:361) <-- ND is nullptr here, crash on ND->getCanonicalDecl()
writeAbiTags (ItaniumMangle.cpp:654)
mangleUnresolvedPrefix (ItaniumMangle.cpp:1122) <-- passes qualifier->getAsNamespaceAlias() as ND
mangleUnresolvedName (ItaniumMangle.cpp:1137)
mangleExpression (ItaniumMangle.cpp:3548)
mangleExpression (ItaniumMangle.cpp:3490)
mangleExpression (ItaniumMangle.cpp:3490)
mangleExpression (ItaniumMangle.cpp:3420)
mangleExpression (ItaniumMangle.cpp:3495)
mangleExpression (ItaniumMangle.cpp:3421)
mangleTemplateArg (ItaniumMangle.cpp:3867)
mangleTemplateArgs (ItaniumMangle.cpp:3823)
...
Looks like some bad copy-pasta in that patch, at line 1122 we're in "case NestedNameSpecifier::Identifier" so getAsNamespaceAlias() makes no sense. Based on the other calls, I think just "writeAbiTags(qualifier)" would be correct. I'm rebuilding now to test.
This also prevents Unreal engine from compiling.