Index: llvm/lib/Demangle/DLangDemangle.cpp =================================================================== --- llvm/lib/Demangle/DLangDemangle.cpp +++ llvm/lib/Demangle/DLangDemangle.cpp @@ -199,6 +199,15 @@ size_t N = 0; do { + // Skip over anonymous symbols. + if (*Mangled == '0') { + do + ++Mangled; + while (*Mangled == '0'); + + continue; + } + if (N++) *Demangled << '.'; Index: llvm/unittests/Demangle/DLangDemangleTest.cpp =================================================================== --- llvm/unittests/Demangle/DLangDemangleTest.cpp +++ llvm/unittests/Demangle/DLangDemangleTest.cpp @@ -34,4 +34,7 @@ std::make_pair("_D88", nullptr), std::make_pair("_D8demangleZ", "demangle"), std::make_pair("_D8demangle4testZ", "demangle.test"), - std::make_pair("_D8demangle4test5test2Z", "demangle.test.test2"))); + std::make_pair("_D8demangle4test5test2Z", "demangle.test.test2"), + std::make_pair("_D8demangle9anonymous0Z", "demangle.anonymous"), + std::make_pair("_D8demangle9anonymous03fooZ", + "demangle.anonymous.foo")));