diff options
author | Jason Merrill <jason@redhat.com> | 2019-03-26 12:02:19 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-03-26 12:02:19 -0400 |
commit | c59fa7eac4a82af74a5cdfe620dca27a45d16843 (patch) | |
tree | 45250c1852f1bfe23db6d53a66beb6a39faac3e9 /gcc/fortran/trans-array.c | |
parent | 7ac205673caade367552a567a98e27940f17cf35 (diff) | |
download | gcc-c59fa7eac4a82af74a5cdfe620dca27a45d16843.zip gcc-c59fa7eac4a82af74a5cdfe620dca27a45d16843.tar.gz gcc-c59fa7eac4a82af74a5cdfe620dca27a45d16843.tar.bz2 |
PR c++/86429 - constexpr variable in lambda.
When we refer to a captured variable from a constant-expression context
inside a lambda, the closure (like any function parameter) is not constant
because we aren't in a call, so we don't have an argument. So the capture
is non-constant. But if the captured variable is constant, we might be able
to use it directly in constexpr evaluation.
PR c++/82643
PR c++/87327
* constexpr.c (cxx_eval_constant_expression): In a lambda function,
try evaluating the captured variable directly.
From-SVN: r269951
Diffstat (limited to 'gcc/fortran/trans-array.c')
0 files changed, 0 insertions, 0 deletions