diff mbox series

Add pretty-printing support for __is_nothrow_{assignable, constructible}. [PR98054]

Message ID CAFk2RUZN5Hnx4het9S+eJwyfXy0_9LC3R1ic88geTar_Wj3cxQ@mail.gmail.com
State New
Headers show
Series Add pretty-printing support for __is_nothrow_{assignable, constructible}. [PR98054] | expand

Commit Message

Ville Voutilainen Nov. 30, 2020, 11:19 a.m. UTC
OK for trunk if full testsuite passes? Should we consider having some sort
of test that catches such omissions?

2020-11-30  Ville Voutilainen  <ville.voutilainen@gmail.com>

    gcc/

    PR c++/98054
    * cp/cxx-pretty-print.c (pp_cxx_trait_expression):
    Add support for __is_nothrow_{assignable,constructible}.

Comments

Marek Polacek Nov. 30, 2020, 1:50 p.m. UTC | #1
On Mon, Nov 30, 2020 at 01:19:32PM +0200, Ville Voutilainen via Gcc-patches wrote:
> OK for trunk if full testsuite passes? Should we consider having some sort
> of test that catches such omissions?

IMHO this doesn't require a test.

> 2020-11-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
> 
>     gcc/
> 
>     PR c++/98054
>     * cp/cxx-pretty-print.c (pp_cxx_trait_expression):
>     Add support for __is_nothrow_{assignable,constructible}.

No "cp/" please.

> diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
> index 058b9c2f4fc..1cdf0772a6b 100644
> --- a/gcc/cp/cxx-pretty-print.c
> +++ b/gcc/cp/cxx-pretty-print.c
> @@ -2666,6 +2666,12 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
>      case CPTK_IS_CONSTRUCTIBLE:
>        pp_cxx_ws_string (pp, "__is_constructible");
>        break;
> +    case CPTK_IS_NOTHROW_ASSIGNABLE:
> +      pp_cxx_ws_string (pp, "__is_nothrow_assignable");
> +      break;
> +    case CPTK_IS_NOTHROW_CONSTRUCTIBLE:
> +      pp_cxx_ws_string (pp, "__is_nothrow_constructible");
> +      break;
>  
>      default:
>        gcc_unreachable ();

Looks fine, thanks.

Marek
Jason Merrill Dec. 1, 2020, 3:28 p.m. UTC | #2
On 11/30/20 8:50 AM, Marek Polacek wrote:
> On Mon, Nov 30, 2020 at 01:19:32PM +0200, Ville Voutilainen via Gcc-patches wrote:
>> OK for trunk if full testsuite passes? Should we consider having some sort
>> of test that catches such omissions?
> 
> IMHO this doesn't require a test.
> 
>> 2020-11-30  Ville Voutilainen  <ville.voutilainen@gmail.com>
>>
>>      gcc/
 >>
>>      PR c++/98054
>>      * cp/cxx-pretty-print.c (pp_cxx_trait_expression):
>>      Add support for __is_nothrow_{assignable,constructible}.
> 
> No "cp/" please.

And change the gcc/ above to gcc/cp/.  OK with that change.

>> diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
>> index 058b9c2f4fc..1cdf0772a6b 100644
>> --- a/gcc/cp/cxx-pretty-print.c
>> +++ b/gcc/cp/cxx-pretty-print.c
>> @@ -2666,6 +2666,12 @@ pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
>>       case CPTK_IS_CONSTRUCTIBLE:
>>         pp_cxx_ws_string (pp, "__is_constructible");
>>         break;
>> +    case CPTK_IS_NOTHROW_ASSIGNABLE:
>> +      pp_cxx_ws_string (pp, "__is_nothrow_assignable");
>> +      break;
>> +    case CPTK_IS_NOTHROW_CONSTRUCTIBLE:
>> +      pp_cxx_ws_string (pp, "__is_nothrow_constructible");
>> +      break;
>>   
>>       default:
>>         gcc_unreachable ();
> 
> Looks fine, thanks.
> 
> Marek
>
diff mbox series

Patch

diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index 058b9c2f4fc..1cdf0772a6b 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -2666,6 +2666,12 @@  pp_cxx_trait_expression (cxx_pretty_printer *pp, tree t)
     case CPTK_IS_CONSTRUCTIBLE:
       pp_cxx_ws_string (pp, "__is_constructible");
       break;
+    case CPTK_IS_NOTHROW_ASSIGNABLE:
+      pp_cxx_ws_string (pp, "__is_nothrow_assignable");
+      break;
+    case CPTK_IS_NOTHROW_CONSTRUCTIBLE:
+      pp_cxx_ws_string (pp, "__is_nothrow_constructible");
+      break;
 
     default:
       gcc_unreachable ();