Re: [PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-22 Thread Jason Merrill via Gcc-patches
On 3/19/21 4:25 PM, Martin Sebor wrote: On 3/19/21 12:49 PM, Jakub Jelinek via Gcc-patches wrote: On Fri, Mar 19, 2021 at 02:17:39PM -0400, Jason Merrill wrote: --- gcc/cp/decl.c.jj    2021-03-16 21:17:41.014498713 +0100 +++ gcc/cp/decl.c    2021-03-18 19:31:22.430149523 +0100 @@ -8629,6 +8629,

Re: [PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-19 Thread Martin Sebor via Gcc-patches
On 3/19/21 12:49 PM, Jakub Jelinek via Gcc-patches wrote: On Fri, Mar 19, 2021 at 02:17:39PM -0400, Jason Merrill wrote: --- gcc/cp/decl.c.jj2021-03-16 21:17:41.014498713 +0100 +++ gcc/cp/decl.c 2021-03-18 19:31:22.430149523 +0100 @@ -8629,6 +8629,11 @@ cp_finish_decomp (tree decl, tre

Re: [PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-19 Thread Jakub Jelinek via Gcc-patches
On Fri, Mar 19, 2021 at 02:17:39PM -0400, Jason Merrill wrote: > > --- gcc/cp/decl.c.jj2021-03-16 21:17:41.014498713 +0100 > > +++ gcc/cp/decl.c 2021-03-18 19:31:22.430149523 +0100 > > @@ -8629,6 +8629,11 @@ cp_finish_decomp (tree decl, tree first, > > : get_tuple_ele

Re: [PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-19 Thread Jason Merrill via Gcc-patches
On 3/19/21 5:53 AM, Jakub Jelinek wrote: Hi! We ICE on the following testcase, because std::tuple_element<...,...>::type is void and for structured bindings we therefore need to create void & or void && which is invalid. We created such REFERENCE_TYPE and later ICEd in the middle-end. The follo

[PATCH] c++: Diagnose references to void in structured bindings [PR99650]

2021-03-19 Thread Jakub Jelinek via Gcc-patches
Hi! We ICE on the following testcase, because std::tuple_element<...,...>::type is void and for structured bindings we therefore need to create void & or void && which is invalid. We created such REFERENCE_TYPE and later ICEd in the middle-end. The following patch fixes it by diagnosing that, wit