summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/MicrosoftMangle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r--clang/lib/AST/MicrosoftMangle.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index 8506c4c8dde..119bc86be29 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -563,9 +563,15 @@ MicrosoftCXXNameMangler::mangleUnqualifiedName(const NamedDecl *ND,
break;
}
- // When VC encounters an anonymous type with no tag and no typedef,
- // it literally emits '<unnamed-tag>@'.
- Out << "<unnamed-tag>@";
+ if (TD->hasDeclaratorForAnonDecl())
+ // Anonymous types with no tag or typedef get the name of their
+ // declarator mangled in.
+ Out << "<unnamed-type-" << TD->getDeclaratorForAnonDecl()->getName()
+ << ">@";
+ else
+ // Anonymous types with no tag, no typedef, or declarator get
+ // '<unnamed-tag>@'.
+ Out << "<unnamed-tag>@";
break;
}
OpenPOWER on IntegriCloud