From 0eb8bbdeab4eee10abf9309c56a201cfc5e1edbe Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Wed, 23 Oct 2013 20:52:43 +0000 Subject: AST: Mangle fields in anonymous structs/unions The Itanium mangler couldn't cope with mangling an IndirectFieldDecl. Instead, mangle the field the IndirectFieldDecl refers to. Further, give IndirectFieldDecl no linkage just like FieldDecl. N.B. Decl.cpp:getLVForNamespaceScopeDecl tried to calculate linkage for data members of anonymous structs/unions. However, this seems impossible so turn it into an assertion. llvm-svn: 193269 --- clang/test/CodeGenCXX/mangle.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/test/CodeGenCXX/mangle.cpp') diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp index 775cf00917b..4e6dbf5397a 100644 --- a/clang/test/CodeGenCXX/mangle.cpp +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -933,3 +933,12 @@ namespace test42 { void g() { func(foo<20, X>()); } } + +namespace test43 { + // CHECK-LABEL: define void @_ZN6test431gEPNS_3zedIXadL_ZNS_3fooUt_3barEEEEE + struct foo { union { int bar; }; }; + template + struct zed {}; + void g(zed<&foo::bar>*) + {} +} -- cgit v1.2.3