diff options
author | 2020-08-09 15:51:07 +0000 | |
---|---|---|
committer | 2020-08-09 15:51:07 +0000 | |
commit | 389bb291c0c8961ca40ac7a2636e1ca69ca7653c (patch) | |
tree | e027d0b3ed5ed27fe08d1bcaa20e3c191232a53b /gnu/llvm/clang/lib/AST/DeclBase.cpp | |
parent | Import LLVM 10.0.1 including clang, lld and lldb. (diff) | |
download | wireguard-openbsd-389bb291c0c8961ca40ac7a2636e1ca69ca7653c.tar.xz wireguard-openbsd-389bb291c0c8961ca40ac7a2636e1ca69ca7653c.zip |
Import LLVM 10.0.1 including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | gnu/llvm/clang/lib/AST/DeclBase.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/clang/lib/AST/DeclBase.cpp b/gnu/llvm/clang/lib/AST/DeclBase.cpp index cb4d61cac2c..cb7c7fcbd4b 100644 --- a/gnu/llvm/clang/lib/AST/DeclBase.cpp +++ b/gnu/llvm/clang/lib/AST/DeclBase.cpp @@ -332,13 +332,16 @@ void Decl::setDeclContextsImpl(DeclContext *SemaDC, DeclContext *LexicalDC, } } -bool Decl::isLexicallyWithinFunctionOrMethod() const { +bool Decl::isInLocalScope() const { const DeclContext *LDC = getLexicalDeclContext(); while (true) { if (LDC->isFunctionOrMethod()) return true; if (!isa<TagDecl>(LDC)) return false; + if (const auto *CRD = dyn_cast<CXXRecordDecl>(LDC)) + if (CRD->isLambda()) + return true; LDC = LDC->getLexicalParent(); } return false; |