Skip to content

Commit 5d4dcf6

Browse files
Add a comment explaining the test hack
1 parent 9877278 commit 5d4dcf6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

gcc/testsuite/g++.dg/contracts/cpp26/throwing-violation-handler.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ void handle_contract_violation(const std::contracts::contract_violation&)
55
throw 666;
66
}
77

8+
/* ODR hack to the hilt - f is actually noexcept, and has a contract.
9+
We do this to avoid the call site knowing that, so that we verify
10+
that the function terminates when it calls the throwing handler
11+
that we use above. */
812
int f(int);
913

1014
extern bool f_result;

0 commit comments

Comments
 (0)