Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Jason Merrill via Gcc-patches
tion in cp_finish_decl? That seems to work nicely :) All xfailed tests for the static data member initialization case now also pass. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Subject: [PATCH] c++: detecting copy-init context during CTAD [PR102137] Here we're

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Patrick Palka via Gcc-patches
; well. And I suppose we might as well use it in do_class_deduction > > > > > > too, > > > > > > since doing so lets us remove the flags parameter. > > > > > > > > > > Before removing the flags parameter please try ass

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Jason Merrill via Gcc-patches
mber initialization case now also pass. Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Subject: [PATCH] c++: detecting copy-init context during CTAD [PR102137] Here we're failing to communicate to cp_finish_decl from tsubst_expr that we're in a copy-initial

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Patrick Palka via Gcc-patches
lass_deduction: > > > >gcc_assert (bool(flags & LOOKUP_ONLYCONVERTING) == is_copy_initialization > > (init)); > > > > Turns out removing the flags parameter breaks CTAD for new-expressions > > of the form 'new TT(x)' because in this case build_new pass

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Jason Merrill via Gcc-patches
ATCH] c++: detecting copy-init context during CTAD [PR102137] Here we're failing to communicate to cp_finish_decl from tsubst_expr that we're in a copy-initialization context (via the LOOKUP_ONLYCONVERTING flag), which causes us to always consider explicit deduction guides when performing CTAD for a te

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-08 Thread Patrick Palka via Gcc-patches
sses just 'x' as the initializer to do_auto_deduction (as opposed to a single TREE_LIST), for which is_copy_initialization returns true even though it's really direct initalization. Also turns out we're similarly not passing the right LOOKUP_* flags to cp_finish_decl from instantiate_body, which breaks co

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-07 Thread Jason Merrill via Gcc-patches
remove the flags parameter. Before removing the flags parameter please try asserting that it now matches is_copy_initialization and see if anything breaks. -- >8 -- Subject: [PATCH] c++: detecting copy-init context during CTAD [PR102137] Here we're failing to communicate to cp_finish_d

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-07 Thread Patrick Palka via Gcc-patches
hat code from build_aggr_init to cp_finish_decl broke things, but using it in both spots seems to work well. And I suppose we might as well use it in do_class_deduction too, since doing so lets us remove the flags parameter. -- >8 -- Subject: [PATCH] c++: detecting copy-init co

Re: [PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-04 Thread Jason Merrill via Gcc-patches
On 3/4/22 14:24, Patrick Palka wrote: Here we're failing to communicate to cp_finish_decl from tsubst_expr that we're in a copy-initialization context (via the LOOKUP_ONLYCONVERTING flag), which causes do_class_deduction to always consider explicit deduction guides when performing CTAD for a

[PATCH] c++: detecting copy-init context during CTAD [PR102137]

2022-03-04 Thread Patrick Palka via Gcc-patches
Here we're failing to communicate to cp_finish_decl from tsubst_expr that we're in a copy-initialization context (via the LOOKUP_ONLYCONVERTING flag), which causes do_class_deduction to always consider explicit deduction guides when performing CTAD for a templated variable initializer. We could