Debian Codegraph @

gcc/testsuite/g++.dg/contracts/except_preload_handler/assert_fail.cpp

raw
1 #include <iostream>
2 #include <contract>
3
4 int fun() {
5 int x = 0;
6 [[ assert: x < 0 ]];
7
8 return 0;
9 }
10
11 int main(int argc, char**) {
12 try {
13 fun();
14 } catch(int &ex) {
15 std::cerr << "synth caught indirect: " << ex << std::endl;
16 }
17
18 return 0;
19 }
20