diff --git lib/AST/MicrosoftMangle.cpp lib/AST/MicrosoftMangle.cpp
index d9fa057..2d91c9f 100644
--- lib/AST/MicrosoftMangle.cpp
+++ lib/AST/MicrosoftMangle.cpp
@@ -1014,6 +1014,9 @@ void MicrosoftCXXNameMangler::mangleType(const FunctionProtoType *T,
   // structor type.
   // I'll probably have mangleType(MemberPointerType) call the mangleType()
   // method directly.
+  // FIXME: the comment above is cryptic for me. Also, seems like this codepath
+  // was not tested before. Not sure what to do with the comment here.
+  Out << "$$A6";
   mangleType(T, NULL, false, false);
 }
 void MicrosoftCXXNameMangler::mangleType(const FunctionNoProtoType *T,
diff --git test/CodeGenCXX/mangle-ms-template-callback.cpp test/CodeGenCXX/mangle-ms-template-callback.cpp
new file mode 100644
index 0000000..02c9da9
--- /dev/null
+++ test/CodeGenCXX/mangle-ms-template-callback.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -emit-llvm %s -o - -cxx-abi microsoft -triple=i386-pc-win32 | FileCheck %s
+
+template <typename Signature>
+class C;
+
+template <typename Ret>
+class C<Ret(void)> {};
+typedef C<void(void)> C0;
+
+template <typename Ret, typename Arg1>
+class C<Ret(Arg1)> {};
+
+template <typename Ret, typename Arg1, typename Arg2>
+class C<Ret(Arg1, Arg2)> {};
+
+C0 callback_void;
+// CHECK: "\01?callback_void@@3V?$C@$$A6AXXZ@@A"
+
+volatile C0 callback_void_volatile;
+// CHECK: "\01?callback_void_volatile@@3V?$C@$$A6AXXZ@@C"
+
+class Type {};
+
+C<int(void)> callback_int;
+// CHECK: "\01?callback_int@@3V?$C@$$A6AHXZ@@A"
+C<Type(void)> callback_Type;
+// CHECK: "\01?callback_Type@@3V?$C@$$A6A?AVType@@XZ@@A"
+
+C<void(int)> callback_void_int;
+// CHECK: "\01?callback_void_int@@3V?$C@$$A6AXH@Z@@A"
+C<int(int)> callback_int_int;
+// CHECK: "\01?callback_int_int@@3V?$C@$$A6AHH@Z@@A"
+C<void(Type)> callback_void_Type;
+// CHECK: "\01?callback_void_Type@@3V?$C@$$A6AXVType@@@Z@@A"
+
+void foo(C0 c) {}
+// CHECK: "\01?foo@@YAXV?$C@$$A6AXXZ@@@Z"
+
+// TODO: more?
diff --git test/CodeGenCXX/mangle-ms.cpp test/CodeGenCXX/mangle-ms.cpp
index ce22931..591fa8a 100644
--- test/CodeGenCXX/mangle-ms.cpp
+++ test/CodeGenCXX/mangle-ms.cpp
@@ -122,7 +122,7 @@ void epsilon(int a[][10][20]) {}
 
 // Blocks mangling (Clang extension).
 void zeta(int (^)(int, int)) {}
-// CHECK: @"\01?zeta@@YAXP_EAHHH@Z@Z"
+// CHECK: @"\01?zeta@@YAXP_E$$A6AHHH@Z@Z"
 
 void operator_new_delete() {
   char *ptr = new char;
