diff options
author | Jakub Jelinek <jakub@redhat.com> | 2022-02-08 20:15:42 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2022-02-08 20:15:42 +0100 |
commit | 1755141a9ea0dddabb52776cddc4c9325eed27c6 (patch) | |
tree | bdd944fff28d346af0a1e1df07a55f1b63639caf /gcc/go/go-gcc.cc | |
parent | 0c3e491a4e5ae74bfbed6d167d403d262b5a4adc (diff) | |
download | gcc-1755141a9ea0dddabb52776cddc4c9325eed27c6.zip gcc-1755141a9ea0dddabb52776cddc4c9325eed27c6.tar.gz gcc-1755141a9ea0dddabb52776cddc4c9325eed27c6.tar.bz2 |
c++: Remove superflous assert [PR104403]
I've added the assert because start_decl diagnoses such vars for C++20 and
earlier:
if (current_function_decl && VAR_P (decl)
&& DECL_DECLARED_CONSTEXPR_P (current_function_decl)
&& cxx_dialect < cxx23)
but as can be seen, we cam trigger the assert in older standards e.g. during
non-manifestly constant evaluation. Rather than refining the assert that
DECL_EXPRs for such vars don't appear for C++20 and older if they are inside
of functions declared constexpr this patch just removes the assert, the
code rejects encountering those vars in constant expressions anyway.
2022-02-08 Jakub Jelinek <jakub@redhat.com>
PR c++/104403
* constexpr.cc (cxx_eval_constant_expression): Don't assert DECL_EXPRs
of TREE_STATIC vars may only appear in -std=c++23.
* g++.dg/cpp0x/lambda/lambda-104403.C: New test.
Diffstat (limited to 'gcc/go/go-gcc.cc')
0 files changed, 0 insertions, 0 deletions