From 8e8888cc60e4daf6f713f7f60c7f9c29db69422a Mon Sep 17 00:00:00 2001 From: Nina Ranns Date: Wed, 22 Jan 2025 18:12:41 +0000 Subject: [PATCH] review comments --- gcc/c-family/c.opt | 6 +++--- gcc/cp/contracts.cc | 6 +++--- .../cpp26/definition-checks/virtual-func-no-def-check.C | 2 +- .../cpp26/definition-checks/virtual-func-no-def-check2.C | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index 1152ce042e501..dd2eeeaf896ef 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -1964,9 +1964,9 @@ fcontracts-nonattr-client-contracts= C++ Joined RejectNegative Enum(client_contract_check) Var(flag_contract_nonattr_client_check) Init (0) -fcontracts-nonattr-client-check=[none|pre|all] Select which contracts will be checked on the client side for non virtual functions -fcontracts-nonattr-def-contracts= -C++ Var(flag_contracts_nonattr_def_contracts) Enum(on_off) Joined Init(1) RejectNegative --fcontracts-nonattr-def-contract=[on|off] Enable or disable contract checks on the definition side for all functions (default on). +fcontracts-nonattr-definition-check= +C++ Joined RejectNegative Enum(on_off) Var(flag_contracts_nonattr_definition_check) Init(1) +-fcontracts-nonattr-definition-check=[on|off] Enable or disable contract checks on the definition side for all functions (default on). fcoroutines C++ LTO Var(flag_coroutines) diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc index a473f043324b1..9e9f73df6a23d 100644 --- a/gcc/cp/contracts.cc +++ b/gcc/cp/contracts.cc @@ -2774,7 +2774,7 @@ start_function_contracts (tree decl1) /* If this is not a client side check and definition side checks are disabled, do nothing. */ - if (!flag_contracts_nonattr_def_contracts && + if (!flag_contracts_nonattr_definition_check && !DECL_CONTRACT_WRAPPER(decl1)) return; @@ -2895,7 +2895,7 @@ maybe_apply_function_contracts (tree fndecl) /* If this is not a client side check and definition side checks are disabled, do nothing. */ - if (!flag_contracts_nonattr_def_contracts && + if (!flag_contracts_nonattr_definition_check && !DECL_CONTRACT_WRAPPER(fndecl)) return; @@ -3034,7 +3034,7 @@ finish_function_contracts (tree fndecl) /* If this is not a client side check and definition side checks are disabled, do nothing. */ - if (!flag_contracts_nonattr_def_contracts && + if (!flag_contracts_nonattr_definition_check && !DECL_CONTRACT_WRAPPER(fndecl)) return; diff --git a/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check.C b/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check.C index 39c4c1dd37c5f..c8a17538d36cf 100644 --- a/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check.C +++ b/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check.C @@ -1,7 +1,7 @@ // check that an invocation of a virtual function through the base class does not // check contracts of the derived function, which are definition side contracts // { dg-do run } -// { dg-options "-std=c++2a -fcontracts -fcontracts-nonattr -fcontracts-nonattr-def-contracts=off " } +// { dg-options "-std=c++2a -fcontracts -fcontracts-nonattr -fcontracts-nonattr-definition-check=off " } struct Base { diff --git a/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check2.C b/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check2.C index faf2da4b71da4..3053ea4fb7b18 100644 --- a/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check2.C +++ b/gcc/testsuite/g++.dg/contracts/cpp26/definition-checks/virtual-func-no-def-check2.C @@ -1,7 +1,7 @@ // check that an invocation of a virtual function through the base class checks // the base class contracts when definition side contracts are turned off // { dg-do run } -// { dg-options "-std=c++2a -fcontracts -fcontracts-nonattr -fcontracts-nonattr-def-contracts=off -fcontract-continuation-mode=on" } +// { dg-options "-std=c++2a -fcontracts -fcontracts-nonattr -fcontracts-nonattr-definition-check=off -fcontract-continuation-mode=on" } struct Base {