-
- Downloads
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.
Showing
- gcc/cp/cp-tree.h 1 addition, 0 deletionsgcc/cp/cp-tree.h
- gcc/cp/decl.cc 125 additions, 25 deletionsgcc/cp/decl.cc
- gcc/cp/parser.cc 2 additions, 0 deletionsgcc/cp/parser.cc
- gcc/doc/extend.texi 3 additions, 0 deletionsgcc/doc/extend.texi
- gcc/testsuite/g++.dg/ext/label15.C 36 additions, 0 deletionsgcc/testsuite/g++.dg/ext/label15.C
- gcc/testsuite/g++.dg/torture/pr42739.C 3 additions, 3 deletionsgcc/testsuite/g++.dg/torture/pr42739.C
Loading
Please register or sign in to comment