c++: Check constant array bounds later.
We give a better diagnostic for non-constant array bounds in compute_array_index_type_loc, we don't need to diagnose it in the parser. But to avoid a regression on parse/varmod1.C we need to actually check non-dependent expressions in a template. gcc/cp/ChangeLog: * decl.c (compute_array_index_type_loc): Diagnose expressions in a template that can't be constant. * parser.c (cp_parser_direct_declarator): Don't check non-constant array bounds here. gcc/testsuite/ChangeLog: * c-c++-common/gomp/depend-iterator-2.c: Adjust. * g++.dg/ext/vla1.C: Adjust. * g++.dg/template/array9.C: Adjust. * g++.dg/template/error41.C: Adjust.
Showing
- gcc/cp/decl.c 6 additions, 6 deletionsgcc/cp/decl.c
- gcc/cp/parser.c 2 additions, 0 deletionsgcc/cp/parser.c
- gcc/testsuite/c-c++-common/gomp/depend-iterator-2.c 1 addition, 1 deletiongcc/testsuite/c-c++-common/gomp/depend-iterator-2.c
- gcc/testsuite/g++.dg/ext/vla1.C 1 addition, 2 deletionsgcc/testsuite/g++.dg/ext/vla1.C
- gcc/testsuite/g++.dg/template/array9.C 2 additions, 2 deletionsgcc/testsuite/g++.dg/template/array9.C
- gcc/testsuite/g++.dg/template/error41.C 1 addition, 1 deletiongcc/testsuite/g++.dg/template/error41.C
Loading
Please register or sign in to comment