diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-09-02 15:50:38 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-09-02 15:50:38 +0000 |
commit | b33cd908d4f873e2a2bc22121bbf1f3d07e25e5b (patch) | |
tree | 31696d2338ccec68394a6a16757aa7be93c90eb6 /clang/lib/AST/MicrosoftMangle.cpp | |
parent | fbcd189f8aab34ac2573ddf8d9ace2921b87e703 (diff) | |
download | bcm5719-llvm-b33cd908d4f873e2a2bc22121bbf1f3d07e25e5b.tar.gz bcm5719-llvm-b33cd908d4f873e2a2bc22121bbf1f3d07e25e5b.zip |
[MS ABI] Number unnamed TagDecls which aren't externally visible
TagDecls (structs, enums, etc.) may have the same name for linkage
purposes of one another; to disambiguate, we add a number to the mangled
named. However, we didn't do this if the TagDecl has a pseudo-name for
linkage purposes (it was defined alongside a DeclaratorDecl or a
TypeNameDecl).
This fixes PR24651.
llvm-svn: 246659
Diffstat (limited to 'clang/lib/AST/MicrosoftMangle.cpp')
-rw-r--r-- | clang/lib/AST/MicrosoftMangle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp index 95ae8f55b4b..dd6e952bbae 100644 --- a/clang/lib/AST/MicrosoftMangle.cpp +++ b/clang/lib/AST/MicrosoftMangle.cpp @@ -180,7 +180,9 @@ public: // Anonymous tags are already numbered. if (const TagDecl *Tag = dyn_cast<TagDecl>(ND)) { - if (Tag->getName().empty() && !Tag->getTypedefNameForAnonDecl()) + if (!Tag->hasNameForLinkage() && + !getASTContext().getDeclaratorForUnnamedTagDecl(Tag) && + !getASTContext().getTypedefNameForUnnamedTagDecl(Tag)) return false; } |