aboutsummaryrefslogtreecommitdiff
path: root/gcc/c/c-decl.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-12-20 13:58:16 -0500
committerJason Merrill <jason@redhat.com>2023-12-20 21:06:35 -0500
commit4d9e0f3f211c8c459f285b5cddabc9958ad170f8 (patch)
treeebc2652ba0f89fec19b2e50d422bced0e3031bc0 /gcc/c/c-decl.cc
parent32bab8b57ddf0df727f5eaf99a77e70882c4e6e2 (diff)
downloadgcc-4d9e0f3f211c8c459f285b5cddabc9958ad170f8.zip
gcc-4d9e0f3f211c8c459f285b5cddabc9958ad170f8.tar.gz
gcc-4d9e0f3f211c8c459f285b5cddabc9958ad170f8.tar.bz2
c++: computed goto warning [PR37722]
PR37722 complains that a computed goto doesn't destroy objects that go out of scope. In the PR we agreed that it never will, but we can warn about it. PR c++/37722 gcc/ChangeLog: * doc/extend.texi: Document that computed goto does not call destructors. gcc/cp/ChangeLog: * decl.cc (identify_goto): Adjust for computed goto. (struct named_label_use_entry): Add computed_goto field. (poplevel_named_label_1): Add to computed_goto vec. (check_previous_goto_1): Dump computed_goto vec. (check_goto_1): Split out from check_goto. (check_goto): Check all addressable labels for computed goto. (struct named_label_entry): Add addressed field. (mark_label_addressed): New. * parser.cc (cp_parser_unary_expression): Call it. * cp-tree.h (mark_label_addressed): Declare it. gcc/testsuite/ChangeLog: * g++.dg/ext/label15.C: New test. * g++.dg/torture/pr42739.C: Expect warning.
Diffstat (limited to 'gcc/c/c-decl.cc')
0 files changed, 0 insertions, 0 deletions