constexpr.c (cxx_eval_constant_expression): If not skipping upon entry to body...
authorJakub Jelinek <jakub@redhat.com>
Wed, 2 Oct 2019 22:32:56 +0000 (00:32 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 2 Oct 2019 22:32:56 +0000 (00:32 +0200)
commit1006c9d4395a939820df76f37c7b085a4a1a003f
tree973f74c8b74c3df61c1379ee1c6ebc66d0fa048a
parent276a52d5566487fa53bcf34f24290362a10ac316
constexpr.c (cxx_eval_constant_expression): If not skipping upon entry to body...

* constexpr.c (cxx_eval_constant_expression) <case CLEANUP_STMT>: If
not skipping upon entry to body, run cleanup with the same *jump_target
as it started to run the cleanup even if the body returns, breaks or
continues.
(potential_constant_expression_1): Allow CLEANUP_STMT.

* g++.dg/ext/constexpr-attr-cleanup1.C: New test.

From-SVN: r276494
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/constexpr-attr-cleanup1.C [new file with mode: 0644]