]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Set the outer brace marker for missed cases.
authorIain Sandoe <iain@sandoe.co.uk>
Sat, 10 May 2025 16:12:44 +0000 (17:12 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Fri, 16 May 2025 13:46:14 +0000 (14:46 +0100)
commit689bc394efe9e042acb37799deec6568c0f63a45
tree4e26ffcf07b8bc2eb4c5c229afacf8ea87282626
parentc875748cdc468ec604c904e19a688998aa4d7a1f
c++: Set the outer brace marker for missed cases.

In some cases, a function might be declared as FUNCTION_NEEDS_BODY_BLOCK
but all the content is contained within that block.  However, poplevel
is currently assuming that such cases would always contain subblocks.

In the case that we do have a body block, but there are no subblocks
then st the outer brace marker on the body block.  This situation occurs
for at least coroutine lambda ramp functions and empty constructors.

gcc/cp/ChangeLog:

* decl.cc (poplevel): Set BLOCK_OUTER_CURLY_BRACE_P on the
body block for functions with no subblocks.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>
gcc/cp/decl.cc