On Mon, Jun 29, 2026 at 06:16:46PM +0200, Jakub Jelinek wrote:
> On Mon, Jun 29, 2026 at 11:43:44AM -0400, Jason Merrill wrote:
> > > https://eel.is/c++draft/class.prop#8.2 says that implicit lifetime
> > > class shall have at least one trivial eligible constructor.
> > > We currently walk all ctors and if it is default/copy/move ctor
> > > which is trivial and not deleted, return true, but as the following 
> > > testcase
> > > shows, we should check also for unsatisfied constraints.
> > 
> > I wonder about adding an eligible_special_function_p function, though it
> > couldn't check the "more constrained" condition and would need to refer to
> > add_method's handling of that.
> > 
> > Let's also add a quote comment here of the section you link to above.
> 
> So like this?
> 
> 2026-06-29  Jakub Jelinek  <[email protected]>
> 
>       PR c++/126007
>       * tree.cc (eligible_special_member_function_p): New function.
>       (implicit_lifetime_type_p): Use true instead of 1 in function comment.
>       Add some further comments.  Use eligible_special_member_function_p
>       instead of !DECL_DELETED_FN.
> 
>       * g++.dg/ext/is_implicit_lifetime3.C: New test.
> 
> --- gcc/cp/tree.cc.jj 2026-06-25 10:03:50.818436378 +0200
> +++ gcc/cp/tree.cc    2026-06-29 18:12:56.381781909 +0200
> @@ -4919,7 +4919,25 @@ trivially_copy_constructible_p (tree t)
>    return is_trivially_xible (INIT_EXPR, t, arg);
>  }
>  
> -/* Returns 1 iff type T is an implicit-lifetime type, as defined in
> +/* Returns true iff FN (which is a special member function) is
> +   an elifible special member function, as defined in [special]/6.

s/elifible/eligible/

Marek

Reply via email to