Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-14 Thread Jason Merrill
Some fixes for bit-field and decltype handling, and address comparison in constant expressions. Tested x86_64-pc-linux-gnu, applied to trunk. On Mon, Nov 14, 2016 at 10:16 AM, Jason Merrill wrote: > On Mon, Nov 14, 2016 at 9:51 AM, Jakub Jelinek wrote: >> On Sun, Nov 13, 2016 at 11:53:10PM -050

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-14 Thread Jason Merrill
On Mon, Nov 14, 2016 at 9:51 AM, Jakub Jelinek wrote: > On Sun, Nov 13, 2016 at 11:53:10PM -0500, Jason Merrill wrote: >> On Wed, Nov 9, 2016 at 8:05 AM, Jakub Jelinek wrote: >> > On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: >> >> The following patch is a WIP on P0217R3 - decomp

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-14 Thread Jakub Jelinek
On Sun, Nov 13, 2016 at 11:53:10PM -0500, Jason Merrill wrote: > On Wed, Nov 9, 2016 at 8:05 AM, Jakub Jelinek wrote: > > On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: > >> The following patch is a WIP on P0217R3 - decomposition declarations. > >> It contains various FIXMEs, Jason

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-14 Thread Jakub Jelinek
On Mon, Nov 14, 2016 at 12:04:24AM -0500, Jason Merrill wrote: > On Wed, Nov 9, 2016 at 7:24 AM, Jakub Jelinek wrote: > > The match.pd hunk is needed, otherwise the generic folding happily folds > > int arr[2]; > > ... > > auto [ x, y ] = arr; > > &x == &arr[0] > > into 0, because it thinks x and

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-14 Thread Richard Biener
On Mon, Nov 14, 2016 at 6:04 AM, Jason Merrill wrote: > On Wed, Nov 9, 2016 at 7:24 AM, Jakub Jelinek wrote: >> The match.pd hunk is needed, otherwise the generic folding happily folds >> int arr[2]; >> ... >> auto [ x, y ] = arr; >> &x == &arr[0] >> into 0, because it thinks x and arr are distin

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-13 Thread Jakub Jelinek
On Mon, Nov 14, 2016 at 08:11:25AM +0100, Jakub Jelinek wrote: > On Sun, Nov 13, 2016 at 11:53:10PM -0500, Jason Merrill wrote: > > On Wed, Nov 9, 2016 at 8:05 AM, Jakub Jelinek wrote: > > > On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: > > >> The following patch is a WIP on P0217

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-13 Thread Jakub Jelinek
On Sun, Nov 13, 2016 at 11:53:10PM -0500, Jason Merrill wrote: > On Wed, Nov 9, 2016 at 8:05 AM, Jakub Jelinek wrote: > > On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: > >> The following patch is a WIP on P0217R3 - decomposition declarations. > >> It contains various FIXMEs, Jason

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-13 Thread Jason Merrill
On Wed, Nov 9, 2016 at 7:24 AM, Jakub Jelinek wrote: > The match.pd hunk is needed, otherwise the generic folding happily folds > int arr[2]; > ... > auto [ x, y ] = arr; > &x == &arr[0] > into 0, because it thinks x and arr are distinct VAR_DECLs. Though, if > such comparisons are required to be

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-13 Thread Jason Merrill
On Wed, Nov 9, 2016 at 8:05 AM, Jakub Jelinek wrote: > On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: >> The following patch is a WIP on P0217R3 - decomposition declarations. >> It contains various FIXMEs, Jason, do you think you could finish it up? Here's what I'm checking in, as

Re: [WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-09 Thread Jakub Jelinek
Hi! On Wed, Nov 09, 2016 at 01:24:22PM +0100, Jakub Jelinek wrote: > The following patch is a WIP on P0217R3 - decomposition declarations. > It contains various FIXMEs, Jason, do you think you could finish it up? Some more comments: Invalid? code like int arr[2]; extern int x, y; auto [ x, y ] =

[WIP C++ PATCH] P0217R3 - C++17 structured bindings

2016-11-09 Thread Jakub Jelinek
Hi! The following patch is a WIP on P0217R3 - decomposition declarations. It contains various FIXMEs, Jason, do you think you could finish it up? The most important unfinished part in the patch is that cp_finish_decomp for classes doesn't try to check if std::tuple_size::value is well-formed inte