Skip to content

Commit 0cb63e7

Browse files
committed
c++, contracts: improve finish_function_contracts guard
1 parent d1960c2 commit 0cb63e7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gcc/cp/contracts.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,8 @@ finish_function_contracts (tree fndecl)
31223122
{
31233123
/* If the guarded func is either already decided to be ill-formed or is
31243124
not yet complete return early. */
3125-
if (fndecl == error_mark_node
3125+
if (error_operand_p (fndecl)
3126+
|| !DECL_INITIAL (fndecl)
31263127
|| DECL_INITIAL (fndecl) == error_mark_node)
31273128
return;
31283129

0 commit comments

Comments
 (0)