Skip to content

Commit 82e3160

Browse files
committed
further review comments
1 parent 408ddfd commit 82e3160

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

gcc/cp/contracts.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ enum constract_assertion_kind {
103103
CAK_INVALID = 0 ,
104104
CAK_PRE = 1 ,
105105
CAK_POST = 2 ,
106-
CAK_ASSERT = 3
106+
CAK_ASSERT = 3,
107+
CAK_MANUAL = 4,
108+
CAK_CASSERT = 5,
107109
};
108110

109111
/* Per P2900R11. */
@@ -118,6 +120,7 @@ enum contract_evaluation_semantic {
118120
};
119121

120122
enum constract_detection_mode {
123+
CDM_UNSPECIFIED = 0,
121124
CDM_PREDICATE_FALSE = 1,
122125
CDM_EVAL_EXCEPTION = 2
123126
};

libstdc++-v3/include/std/contracts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ namespace contracts
101101
// From P3290
102102
unspecified = 0,
103103
predicate_false = 1,
104-
evaluation_exception = 3
104+
evaluation_exception = 2
105105
/* to be extended with implementation−defined values and by future extensions
106106
Implementation−defined values should have a minimum value of 1000. */
107107
};
108108

109109
using __vendor_ext = void;
110110

111111
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;
115115
detection_mode _M_detection_mode;
116116
assertion_kind _M_assertion_kind;
117117
std::source_location _M_source_location;

libstdc++-v3/src/experimental/contract26.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
2424
// <http://www.gnu.org/licenses/>.
2525

26-
#include "../../include/std/contracts"
26+
#include <contracts>
2727
#if _GLIBCXX_HOSTED && _GLIBCXX_VERBOSE
2828
# include <iostream>
2929
# include <cxxabi.h>
@@ -58,7 +58,7 @@ void __handle_contract_violation(const std::contracts::contract_violation &viola
5858
std::cerr << " manual";
5959
break;
6060
default:
61-
std::cerr << " unknown: " << (int) violation.semantic();
61+
std::cerr << " unknown: " << (int) violation.kind();
6262
}
6363
delimiter = ", ";
6464

@@ -89,7 +89,7 @@ void __handle_contract_violation(const std::contracts::contract_violation &viola
8989
std::cerr << " unspecified";
9090
break;
9191
default:
92-
std::cerr << " unknown";
92+
std::cerr << " unknown: " << (int) violation.mode();
9393
}
9494
delimiter = ", ";
9595

libstdc++-v3/testsuite/18_support/contracts/invoke_default_cvh.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
// { dg-options "-g0 -fcontracts -fcontracts-nonattr -fcontract-evaluation-semantic=observe" }
1919
// { dg-do run { target c++2a } }
2020

21+
#include <contracts>
2122
#include <testsuite_hooks.h>
22-
#include "../../../include/std/contracts"
2323

2424
bool custom_called = false;
2525

libstdc++-v3/testsuite/18_support/contracts/invoke_default_cvh2.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@
1818
// { dg-options "-g0 -fcontracts -fcontracts-nonattr -fcontract-evaluation-semantic=observe" }
1919
// { dg-do run { target c++2a } }
2020

21+
#include <contracts>
2122
#include <testsuite_hooks.h>
2223
#include <iostream>
2324
#include <sstream>
2425

25-
#include "../../../include/std/contracts"
26-
2726

2827
struct checking_buf
2928
: public std::streambuf

0 commit comments

Comments
 (0)