return;
}
- while (isa<LinkageSpecDecl>(DC))
- DC = getEffectiveParentContext(DC);
+ DC = IgnoreLinkageSpecDecls(DC);
if (DC->isTranslationUnit() || isStdNamespace(DC)) {
// Check if we have a template.
void CXXNameMangler::mangleUnscopedName(const NamedDecl *ND) {
// <unscoped-name> ::= <unqualified-name>
// ::= St <unqualified-name> # ::std::
- if (isStdNamespace(getEffectiveDeclContext(ND)))
+
+ if (isStdNamespace(IgnoreLinkageSpecDecls(getEffectiveDeclContext(ND))))
Out << "St";
mangleUnqualifiedName(ND);
// ::= # empty
// ::= <substitution>
- while (isa<LinkageSpecDecl>(DC))
- DC = getEffectiveParentContext(DC);
+ DC = IgnoreLinkageSpecDecls(DC);
if (DC->isTranslationUnit())
return;
--- /dev/null
+// RUN: %clang_cc1 %s -DNS=std -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-STD
+// RUN: %clang_cc1 %s -DNS=n -emit-llvm -o - | FileCheck %s --check-prefix=CHECK-N
+
+// _ZNSt1DISt1CE1iE = std::D<std::C>::i
+// CHECK-STD: @_ZNSt1DISt1CE1iE =
+
+// _ZN1n1DINS_1CEE1iE == n::D<n::C>::i
+// CHECK-N: @_ZN1n1DINS_1CEE1iE =
+
+namespace NS {
+ extern "C" {
+ class C {
+ };
+ }
+
+ template <class T>
+ class D {
+ public:
+ static int i;
+ };
+
+}
+
+
+int f() {
+ return NS::D<NS::C>::i;
+}