aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/21_strings/basic_string
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2025-07-07 09:17:34 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2025-07-07 09:25:15 +0200
commit66455591fac1e80b5acc615598cbf556d565e080 (patch)
treed43f2c38aba059b27a4770c4ef7ed1b4765dcfed /libstdc++-v3/testsuite/21_strings/basic_string
parent849878d4fd40ad4ac2bff9a7bfe50176051d7176 (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
c++: Pedwarn on invalid decl specifiers for for-range-declaration [PR84009]HEADtrunkmaster
https://eel.is/c++draft/stmt.ranged#2 says that in for-range-declaration only type-specifier or constexpr can appear. As the following testcases show, we've emitted some diagnostics in most cases, but not for static/thread_local (the patch handles __thread too) and register in the non-sb case. For extern there was an error that it is both extern and has an initializer (again, non-sb only, sb errors on extern). The following patch diagnoses those cases with pedwarn. I've used for-range-declaration in the diagnostics wording (there was already a case of that for the typedef), so that in the future we don't need to differentiate it between range for and expansion statements. 2025-07-07 Jakub Jelinek <jakub@redhat.com> PR c++/84009 * parser.cc (cp_parser_decomposition_declaration): Pedwarn on thread_local, __thread or static in decl_specifiers for for-range-declaration. (cp_parser_init_declarator): Likewise, and also for extern or register. * g++.dg/cpp0x/range-for40.C: New test. * g++.dg/cpp0x/range-for41.C: New test. * g++.dg/cpp0x/range-for42.C: New test. * g++.dg/cpp0x/range-for43.C: New test.
Diffstat (limited to 'libstdc++-v3/testsuite/21_strings/basic_string')
0 files changed, 0 insertions, 0 deletions