diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-05 01:23:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2019-09-05 01:23:47 +0000 |
commit | 7ac42374abc01d89235c862cc44da0c6c930489c (patch) | |
tree | dfa0f8c87bd7d45416dbf1520df1f39a5e159e77 /clang/lib/AST/DeclBase.cpp | |
parent | 33b8a55329b9a968e4f2d859610d638d7fb394e5 (diff) | |
download | llvm-7ac42374abc01d89235c862cc44da0c6c930489c.zip llvm-7ac42374abc01d89235c862cc44da0c6c930489c.tar.gz llvm-7ac42374abc01d89235c862cc44da0c6c930489c.tar.bz2 |
[c++20] Fix some ambiguities in our mangling of lambdas with explicit
template parameters.
This finishes the implementation of the proposal described in
https://github.com/itanium-cxx-abi/cxx-abi/issues/31. (We already
implemented the <lambda-sig> extensions, but didn't take them into
account when computing mangling numbers, and didn't deal properly with
expanded parameter packs, and didn't disambiguate between different
levels of template parameters in manglings.)
llvm-svn: 371004
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index fd80e15..aa2c212 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -12,6 +12,7 @@ #include "clang/AST/DeclBase.h" #include "clang/AST/ASTContext.h" +#include "clang/AST/ASTLambda.h" #include "clang/AST/ASTMutationListener.h" #include "clang/AST/Attr.h" #include "clang/AST/AttrIterator.h" @@ -1043,6 +1044,12 @@ DeclContext *DeclContext::getLookupParent() { getLexicalParent()->getRedeclContext()->isRecord()) return getLexicalParent(); + // A lookup within the call operator of a lambda never looks in the lambda + // class; instead, skip to the context in which that closure type is + // declared. + if (isLambdaCallOperator(this)) + return getParent()->getParent(); + return getParent(); } |