PR13047: Fix various abuses of clang::Type in the MS mangler, to make it work
in the presence of type sugar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158184 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/mangle-ms.cpp b/test/CodeGenCXX/mangle-ms.cpp
index ff75768..cf4055f 100644
--- a/test/CodeGenCXX/mangle-ms.cpp
+++ b/test/CodeGenCXX/mangle-ms.cpp
@@ -12,6 +12,9 @@
 // CHECK: @"\01?j@@3P6GHCE@ZA"
 // CHECK: @"\01?k@@3PTfoo@@DA"
 // CHECK: @"\01?l@@3P8foo@@AEHH@ZA"
+// CHECK: @"\01?color1@@3PANA"
+// CHECK: @"\01?color2@@3PBNA"
+// CHECK: @"\01?color3@@3PBY02NA"
 
 int a;
 
@@ -41,6 +44,8 @@
 //CHECK: @"\01??0foo@@QAE@PAD@Z"
 }f,s1(1),s2((char*)0);
 
+typedef foo (foo2);
+
 struct bar {
   static int g;
 };
@@ -72,9 +77,9 @@
 
 int (__stdcall *j)(signed char, unsigned char);
 
-const volatile char foo::*k;
+const volatile char foo2::*k;
 
-int (foo::*l)(int);
+int (foo2::*l)(int);
 
 // Static functions are mangled, too.
 // Also make sure calling conventions, arglists, and throw specs work.
@@ -121,3 +126,9 @@
 void (redundant_parens)();
 void redundant_parens_use() { redundant_parens(); }
 // CHECK: @"\01?redundant_parens@@YAXXZ"
+
+// PR13047
+typedef double RGB[3];
+RGB color1;
+extern const RGB color2 = {};
+extern RGB const ((color3)[5]) = {};