File tree Expand file tree Collapse file tree 5 files changed +13
-11
lines changed
testsuite/18_support/contracts Expand file tree Collapse file tree 5 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,9 @@ enum constract_assertion_kind {
103
103
CAK_INVALID = 0 ,
104
104
CAK_PRE = 1 ,
105
105
CAK_POST = 2 ,
106
- CAK_ASSERT = 3
106
+ CAK_ASSERT = 3 ,
107
+ CAK_MANUAL = 4 ,
108
+ CAK_CASSERT = 5 ,
107
109
};
108
110
109
111
/* Per P2900R11. */
@@ -118,6 +120,7 @@ enum contract_evaluation_semantic {
118
120
};
119
121
120
122
enum constract_detection_mode {
123
+ CDM_UNSPECIFIED = 0 ,
121
124
CDM_PREDICATE_FALSE = 1 ,
122
125
CDM_EVAL_EXCEPTION = 2
123
126
};
Original file line number Diff line number Diff line change @@ -101,17 +101,17 @@ namespace contracts
101
101
// From P3290
102
102
unspecified = 0 ,
103
103
predicate_false = 1 ,
104
- evaluation_exception = 3
104
+ evaluation_exception = 2
105
105
/* to be extended with implementation−defined values and by future extensions
106
106
Implementation−defined values should have a minimum value of 1000. */
107
107
};
108
108
109
109
using __vendor_ext = void ;
110
110
111
111
class contract_violation {
112
- int version = 0 ;
113
- __vendor_ext* _M_ext = nullptr ;
114
- const char * _M_comment = nullptr ;
112
+ int _M_version ;
113
+ __vendor_ext* _M_ext;
114
+ const char * _M_comment;
115
115
detection_mode _M_detection_mode;
116
116
assertion_kind _M_assertion_kind;
117
117
std::source_location _M_source_location;
Original file line number Diff line number Diff line change 23
23
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24
24
// <http://www.gnu.org/licenses/>.
25
25
26
- #include " ../../include/std/ contracts"
26
+ #include < contracts>
27
27
#if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE
28
28
# include < iostream>
29
29
# include < cxxabi.h>
@@ -58,7 +58,7 @@ void __handle_contract_violation(const std::contracts::contract_violation &viola
58
58
std::cerr << " manual" ;
59
59
break ;
60
60
default :
61
- std::cerr << " unknown: " << (int ) violation.semantic ();
61
+ std::cerr << " unknown: " << (int ) violation.kind ();
62
62
}
63
63
delimiter = " , " ;
64
64
@@ -89,7 +89,7 @@ void __handle_contract_violation(const std::contracts::contract_violation &viola
89
89
std::cerr << " unspecified" ;
90
90
break ;
91
91
default :
92
- std::cerr << " unknown" ;
92
+ std::cerr << " unknown: " << ( int ) violation. mode () ;
93
93
}
94
94
delimiter = " , " ;
95
95
Original file line number Diff line number Diff line change 18
18
// { dg-options "-g0 -fcontracts -fcontracts-nonattr -fcontract-evaluation-semantic=observe" }
19
19
// { dg-do run { target c++2a } }
20
20
21
+ #include < contracts>
21
22
#include < testsuite_hooks.h>
22
- #include " ../../../include/std/contracts"
23
23
24
24
bool custom_called = false ;
25
25
Original file line number Diff line number Diff line change 18
18
// { dg-options "-g0 -fcontracts -fcontracts-nonattr -fcontract-evaluation-semantic=observe" }
19
19
// { dg-do run { target c++2a } }
20
20
21
+ #include < contracts>
21
22
#include < testsuite_hooks.h>
22
23
#include < iostream>
23
24
#include < sstream>
24
25
25
- #include " ../../../include/std/contracts"
26
-
27
26
28
27
struct checking_buf
29
28
: public std::streambuf
You can’t perform that action at this time.
0 commit comments