diff options
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index fb3ac072f1e..0715650b8a2 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -317,12 +317,13 @@ Sema::getCurrentMangleNumberContext(const DeclContext *DC, case Normal: { // -- the bodies of non-exported nonspecialized template functions // -- the bodies of inline functions - auto *CD = dyn_cast<CapturedDecl>(CurContext); if ((IsInNonspecializedTemplate && !(ManglingContextDecl && isa<ParmVarDecl>(ManglingContextDecl))) || - isInInlineFunction(CurContext) || CD) { + isInInlineFunction(CurContext)) { ManglingContextDecl = nullptr; - return &Context.getManglingNumberContext(CD ? CD->getParent() : DC); + while (auto *CD = dyn_cast<CapturedDecl>(DC)) + DC = CD->getParent(); + return &Context.getManglingNumberContext(DC); } ManglingContextDecl = nullptr; |

