diff options
author | Sirraide <aeternalmail@gmail.com> | 2024-04-09 14:52:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-09 14:52:52 +0200 |
commit | 38824f285f1459cb890337d2df1a3cafd3fd109d (patch) | |
tree | 5a59762a708e65c906806e10623809ac95ca9b14 /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | a4cf479cdf08093b69177dd9adf32eebf3632dc3 (diff) | |
download | llvm-38824f285f1459cb890337d2df1a3cafd3fd109d.zip llvm-38824f285f1459cb890337d2df1a3cafd3fd109d.tar.gz llvm-38824f285f1459cb890337d2df1a3cafd3fd109d.tar.bz2 |
[Clang] [Sema] Fix dependence of DREs in lambdas with an explicit object parameter (#84473)
This fixes some problems wrt dependence of captures in lambdas with
an explicit object parameter.
[temp.dep.expr] states that
> An id-expression is type-dependent if [...] its terminal name is
> - associated by name lookup with an entity captured by copy
> ([expr.prim.lambda.capture]) in a lambda-expression that has
> an explicit object parameter whose type is dependent [dcl.fct].
There were several issues with our implementation of this:
1. we were treating by-reference captures as dependent rather than
by-value captures;
2. tree transform wasn't checking whether referring to such a
by-value capture should make a DRE dependent;
3. when checking whether a DRE refers to such a by-value capture, we
were only looking at the immediately enclosing lambda, and not
at any parent lambdas;
4. we also forgot to check for implicit by-value captures;
5. lastly, we were attempting to determine whether a lambda has an
explicit object parameter by checking the `LambdaScopeInfo`'s
`ExplicitObjectParameter`, but it seems that that simply wasn't
set (yet) by the time we got to the check.
All of these should be fixed now.
This fixes #70604, #79754, #84163, #84425, #86054, #86398, and #86399.
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
0 files changed, 0 insertions, 0 deletions