]> granicus.if.org Git - clang/commitdiff
PR13022: cope with parenthesized function types in MS name mangling.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 4 Jun 2012 22:46:59 +0000 (22:46 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 4 Jun 2012 22:46:59 +0000 (22:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157959 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/MicrosoftMangle.cpp
test/CodeGenCXX/mangle-ms.cpp

index 7bcc2f384acc961e5a3db9b2697bd3f8cc978daf..598488170288cd96b3825436dac2e67b0f9243e8 100644 (file)
@@ -198,7 +198,7 @@ void MicrosoftCXXNameMangler::mangleFunctionEncoding(const FunctionDecl *FD) {
   
   // We should never ever see a FunctionNoProtoType at this point.
   // We don't even know how to mangle their types anyway :).
-  const FunctionProtoType *FT = cast<FunctionProtoType>(FD->getType());
+  const FunctionProtoType *FT = FD->getType()->castAs<FunctionProtoType>();
 
   bool InStructor = false, InInstMethod = false;
   const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD);
index 6556ab730866992791d5fb28c7eb80c744fc21bd..ff757685b2dcdab4e091fee9199d771c30e685a3 100644 (file)
@@ -116,3 +116,8 @@ void operator_new_delete() {
   delete [] array;
 // CHECK: @"\01??_V@YAXPAX@Z"
 }
+
+// PR13022
+void (redundant_parens)();
+void redundant_parens_use() { redundant_parens(); }
+// CHECK: @"\01?redundant_parens@@YAXXZ"