diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-11-15 13:15:20 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-11-15 13:15:20 +0000 |
commit | f7300d5cb168b5504ffcefe715c8218936757a59 (patch) | |
tree | 58901467448670674930f0a2e66b937e4f84c32f /clang/lib/Sema/SemaLambda.cpp | |
parent | 61c3046408976846f85af67b68bf82a6e8103c61 (diff) | |
download | bcm5719-llvm-f7300d5cb168b5504ffcefe715c8218936757a59.tar.gz bcm5719-llvm-f7300d5cb168b5504ffcefe715c8218936757a59.zip |
[OPENMP] Fix for PR30632: Name mangling issue.
Reworked fix after comments from Richard Smith. We must skip all
CapturedDecl-based contexts when trying to get correct mangling number
context.
llvm-svn: 286953
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-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; |