[C++ PATCH] Fix PR 55418

Paolo Carlini paolo.carlini@oracle.com
Fri Nov 23 15:50:00 GMT 2012


Hi,

On 11/23/2012 04:47 PM, Jason Merrill wrote:
> On 11/23/2012 10:46 AM, Jason Merrill wrote:
>> On 11/22/2012 11:03 AM, Paolo Carlini wrote:
>>> initialized to true too), but Markus (and me ;) proposes anyway to
>>> initialize trivial_p to false, thus we should be fine (way below
>>> trivial_p is used again but only when deleted_p is false).
>>
>> It certainly can't hurt.
>
> Actually...we should be calculating triviality normally regardless of 
> whether the function is deleted.  Why isn't that happening?
Because in synthesized_method_walk for lambdas we have this early return:

   if (deleted_p)
     {
       /* "The closure type associated with a lambda-expression has a 
deleted
      default constructor and a deleted copy assignment operator."
          This is diagnosed in maybe_explain_implicit_delete.  */
       if (LAMBDA_TYPE_P (ctype)
       && (sfk == sfk_constructor
           || sfk == sfk_copy_assignment))
     {
       *deleted_p = true;
       return;
     }

       *deleted_p = false;
     }

Paolo.



More information about the Gcc-patches mailing list