[1/4] contracts: Lowercase {MAYBE,NEVER}_CONTINUE

Message ID 20221210094303.2180127-2-arsen@aarsen.me
State Accepted
Headers
Series c++: Small tweaks to contracts |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Arsen Arsenović Dec. 10, 2022, 9:43 a.m. UTC
  The lowercase constants are more consistent with the standard, and it is
unlikely that the uppercase versions would've been accepted.

gcc/cp/ChangeLog:

	* contracts.cc: Rename references to
	contract_violation_continuation_mode constants to be lowercase.

libstdc++-v3/ChangeLog:

	* include/experimental/contract: Lowercase the constants in
	contract_violation_continuation_mode.
---
 gcc/cp/contracts.cc                        | 4 ++--
 libstdc++-v3/include/experimental/contract | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Jonathan Wakely Dec. 10, 2022, 11:15 a.m. UTC | #1
On Sat, 10 Dec 2022, 09:51 Arsen Arsenović via Libstdc++, <
libstdc++@gcc.gnu.org> wrote:

> The lowercase constants are more consistent with the standard, and it is
> unlikely that the uppercase versions would've been accepted.
>
> gcc/cp/ChangeLog:
>
>         * contracts.cc: Rename references to
>         contract_violation_continuation_mode constants to be lowercase.
>
> libstdc++-v3/ChangeLog:
>
>         * include/experimental/contract: Lowercase the constants in
>         contract_violation_continuation_mode.
>

OK as far as the library side goes.


---
>  gcc/cp/contracts.cc                        | 4 ++--
>  libstdc++-v3/include/experimental/contract | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
> index 45f52b20392..26316372389 100644
> --- a/gcc/cp/contracts.cc
> +++ b/gcc/cp/contracts.cc
> @@ -41,9 +41,9 @@ along with GCC; see the file COPYING3.  If not see
>          "v > 0", // comment,
>          "default", // assertion_level,
>          "default", // assertion_role,
> -        MAYBE_CONTINUE, // continuation_mode
> +        maybe_continue, // continuation_mode
>         });
> -       terminate (); // if NEVER_CONTINUE
> +       terminate (); // if never_continue
>       }
>
>     We use an internal type with the same layout as contract_violation
> rather
> diff --git a/libstdc++-v3/include/experimental/contract
> b/libstdc++-v3/include/experimental/contract
> index cf655023da7..a2babed6301 100644
> --- a/libstdc++-v3/include/experimental/contract
> +++ b/libstdc++-v3/include/experimental/contract
> @@ -45,7 +45,7 @@ namespace experimental
>  {
>    // From P1332
>    enum class contract_violation_continuation_mode {
> -    NEVER_CONTINUE, MAYBE_CONTINUE
> +    never_continue, maybe_continue
>    };
>
>    class contract_violation {
> --
> 2.38.1
>
>
  
Jason Merrill Dec. 15, 2022, 4:25 p.m. UTC | #2
On 12/10/22 04:43, Arsen Arsenović wrote:
> The lowercase constants are more consistent with the standard, and it is
> unlikely that the uppercase versions would've been accepted.

OK.

> gcc/cp/ChangeLog:
> 
> 	* contracts.cc: Rename references to
> 	contract_violation_continuation_mode constants to be lowercase.
> 
> libstdc++-v3/ChangeLog:
> 
> 	* include/experimental/contract: Lowercase the constants in
> 	contract_violation_continuation_mode.
> ---
>   gcc/cp/contracts.cc                        | 4 ++--
>   libstdc++-v3/include/experimental/contract | 2 +-
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
> index 45f52b20392..26316372389 100644
> --- a/gcc/cp/contracts.cc
> +++ b/gcc/cp/contracts.cc
> @@ -41,9 +41,9 @@ along with GCC; see the file COPYING3.  If not see
>   	 "v > 0", // comment,
>   	 "default", // assertion_level,
>   	 "default", // assertion_role,
> -	 MAYBE_CONTINUE, // continuation_mode
> +	 maybe_continue, // continuation_mode
>          });
> -       terminate (); // if NEVER_CONTINUE
> +       terminate (); // if never_continue
>        }
>   
>      We use an internal type with the same layout as contract_violation rather
> diff --git a/libstdc++-v3/include/experimental/contract b/libstdc++-v3/include/experimental/contract
> index cf655023da7..a2babed6301 100644
> --- a/libstdc++-v3/include/experimental/contract
> +++ b/libstdc++-v3/include/experimental/contract
> @@ -45,7 +45,7 @@ namespace experimental
>   {
>     // From P1332
>     enum class contract_violation_continuation_mode {
> -    NEVER_CONTINUE, MAYBE_CONTINUE
> +    never_continue, maybe_continue
>     };
>   
>     class contract_violation {
  
Arsen Arsenović Dec. 15, 2022, 5:39 p.m. UTC | #3
Hi,

Jason Merrill <jason@redhat.com> writes:

>> The lowercase constants are more consistent with the standard, and it is
>> unlikely that the uppercase versions would've been accepted.
>
> OK.

Thanks.  Could you push this for me?  I don't have write access.

Have a great day.
  
Jason Merrill Dec. 20, 2022, 5:16 p.m. UTC | #4
On 12/15/22 12:39, Arsen Arsenović wrote:
> Hi,
> 
> Jason Merrill <jason@redhat.com> writes:
> 
>>> The lowercase constants are more consistent with the standard, and it is
>>> unlikely that the uppercase versions would've been accepted.
>>
>> OK.
> 
> Thanks.  Could you push this for me?  I don't have write access.

Done.

Jason
  

Patch

diff --git a/gcc/cp/contracts.cc b/gcc/cp/contracts.cc
index 45f52b20392..26316372389 100644
--- a/gcc/cp/contracts.cc
+++ b/gcc/cp/contracts.cc
@@ -41,9 +41,9 @@  along with GCC; see the file COPYING3.  If not see
 	 "v > 0", // comment,
 	 "default", // assertion_level,
 	 "default", // assertion_role,
-	 MAYBE_CONTINUE, // continuation_mode
+	 maybe_continue, // continuation_mode
        });
-       terminate (); // if NEVER_CONTINUE
+       terminate (); // if never_continue
      }
 
    We use an internal type with the same layout as contract_violation rather
diff --git a/libstdc++-v3/include/experimental/contract b/libstdc++-v3/include/experimental/contract
index cf655023da7..a2babed6301 100644
--- a/libstdc++-v3/include/experimental/contract
+++ b/libstdc++-v3/include/experimental/contract
@@ -45,7 +45,7 @@  namespace experimental
 {
   // From P1332
   enum class contract_violation_continuation_mode {
-    NEVER_CONTINUE, MAYBE_CONTINUE
+    never_continue, maybe_continue
   };
 
   class contract_violation {