diff options
author | Faisal Vali <faisalv@yahoo.com> | 2017-05-02 20:56:34 +0000 |
---|---|---|
committer | Faisal Vali <faisalv@yahoo.com> | 2017-05-02 20:56:34 +0000 |
commit | 999f27e3739efbe43edd1baa09dedd9dcea68d6f (patch) | |
tree | a8917fe0ceede6935aa02b2275b47826e6abab0e /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | c7695a8e4565afb256aad1a705ef292bc3625a36 (diff) | |
download | bcm5719-llvm-999f27e3739efbe43edd1baa09dedd9dcea68d6f.tar.gz bcm5719-llvm-999f27e3739efbe43edd1baa09dedd9dcea68d6f.zip |
Fix PR32831 (Try Again): 'this' capture while instantiating generic lambda call operator specialization
When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda.
https://bugs.llvm.org/show_bug.cgi?id=32831
This patch was initially committed here: https://reviews.llvm.org/rL301735
Then reverted here: https://reviews.llvm.org/rL301916
The issue with the original patch was a failure to check that the closure type has been created within the LambdaScopeInfo before querying its DeclContext - instead of just assuming it has (silly!). A reduced example such as this highlights the problem:
struct X {
int data;
auto foo() { return [] { return [] -> decltype(data) { return 0; }; }; }
};
When 'data' within decltype(data) tries to determine the type of 'this', none of the LambdaScopeInfo's have their closure types created at that point.
llvm-svn: 301972
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions