]> granicus.if.org Git - clang/commit
[MS ABI] Correctly mangle classes without names for linkage purposes
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 31 Aug 2015 18:48:39 +0000 (18:48 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 31 Aug 2015 18:48:39 +0000 (18:48 +0000)
commitd17ec04400eee3fef6d1d6f71fdeceb226a3181d
treec10e72b33570d1934062acffbe9807b54d7d171e
parentc26554dd3bce88e59f4ad11c9ca0c5ac1c0cf3fd
[MS ABI] Correctly mangle classes without names for linkage purposes

A class without a name for linkage purposes gets a name along the lines
of <unnamed-type-foo> where foo is either the name of a declarator which
defined it (like a variable or field) or a
typedef-name (like a typedef or alias-declaration).

We handled the declarator case correctly but it would fall down during
template instantiation if the declarator didn't share the tag's type.
We failed to handle the typedef-name case at all.

Instead, keep track of the association between the two and keep it up to
date in the face of template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@246469 91177308-0d34-0410-b5e6-96231b3b80d8
14 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/Decl.h
lib/AST/ASTContext.cpp
lib/AST/CXXABI.h
lib/AST/Decl.cpp
lib/AST/ItaniumCXXABI.cpp
lib/AST/MicrosoftCXXABI.cpp
lib/AST/MicrosoftMangle.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriterDecl.cpp
test/CodeGenCXX/mangle-ms-cxx11.cpp
test/CodeGenCXX/mangle-ms.cpp