]> granicus.if.org Git - clang/commitdiff
Fix for Itanium mangler issue with templates
authorDmitry Polukhin <dmitry.polukhin@gmail.com>
Wed, 14 Jun 2017 09:47:47 +0000 (09:47 +0000)
committerDmitry Polukhin <dmitry.polukhin@gmail.com>
Wed, 14 Jun 2017 09:47:47 +0000 (09:47 +0000)
Patch by Serge Preis

Differential Revision: https://reviews.llvm.org/D32428

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305377 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ItaniumMangle.cpp

index c9bb45a37eb5afe7691c98a61ee2a63216ef248b..dc25e5213bae432c252b9a3ac4f6bb36f03217e7 100644 (file)
@@ -4550,9 +4550,11 @@ CXXNameMangler::makeFunctionReturnTypeTags(const FunctionDecl *FD) {
 
   const FunctionProtoType *Proto =
       cast<FunctionProtoType>(FD->getType()->getAs<FunctionType>());
+  FunctionTypeDepthState saved = TrackReturnTypeTags.FunctionTypeDepth.push();
   TrackReturnTypeTags.FunctionTypeDepth.enterResultType();
   TrackReturnTypeTags.mangleType(Proto->getReturnType());
   TrackReturnTypeTags.FunctionTypeDepth.leaveResultType();
+  TrackReturnTypeTags.FunctionTypeDepth.pop(saved);
 
   return TrackReturnTypeTags.AbiTagsRoot.getSortedUniqueUsedAbiTags();
 }