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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193269 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/mangle.cpp b/test/CodeGenCXX/mangle.cpp
index 775cf00..4e6dbf5 100644
--- a/test/CodeGenCXX/mangle.cpp
+++ b/test/CodeGenCXX/mangle.cpp
@@ -933,3 +933,12 @@
 
   void g() { func(foo<20, X>()); }
 }
+
+namespace test43 {
+  // CHECK-LABEL: define void @_ZN6test431gEPNS_3zedIXadL_ZNS_3fooUt_3barEEEEE
+  struct foo { union { int bar; }; };
+  template <int (foo::*)>
+  struct zed {};
+  void g(zed<&foo::bar>*)
+  {}
+}