From: Dmitry Polukhin Date: Wed, 14 Jun 2017 09:47:47 +0000 (+0000) Subject: Fix for Itanium mangler issue with templates X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=87067b91e3c0fdbdc26c049e97b35c943fa97c78;p=clang Fix for Itanium mangler issue with templates 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 --- diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index c9bb45a37e..dc25e5213b 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -4550,9 +4550,11 @@ CXXNameMangler::makeFunctionReturnTypeTags(const FunctionDecl *FD) { const FunctionProtoType *Proto = cast(FD->getType()->getAs()); + FunctionTypeDepthState saved = TrackReturnTypeTags.FunctionTypeDepth.push(); TrackReturnTypeTags.FunctionTypeDepth.enterResultType(); TrackReturnTypeTags.mangleType(Proto->getReturnType()); TrackReturnTypeTags.FunctionTypeDepth.leaveResultType(); + TrackReturnTypeTags.FunctionTypeDepth.pop(saved); return TrackReturnTypeTags.AbiTagsRoot.getSortedUniqueUsedAbiTags(); }