Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-27 Thread Marek Polacek
On Sat, Jan 26, 2019 at 07:22:17PM -0500, Jason Merrill wrote: > On Fri, Jan 25, 2019 at 4:20 PM Marek Polacek wrote: > > On Fri, Jan 25, 2019 at 10:05:00AM -0500, Jason Merrill wrote: > > > On 1/24/19 7:17 PM, Marek Polacek wrote: > > > > On Wed, Jan 23, 2019 at 03:34:04PM -0500, Jason Merrill

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-26 Thread Jason Merrill
On Fri, Jan 25, 2019 at 4:20 PM Marek Polacek wrote: > On Fri, Jan 25, 2019 at 10:05:00AM -0500, Jason Merrill wrote: > > On 1/24/19 7:17 PM, Marek Polacek wrote: > > > On Wed, Jan 23, 2019 at 03:34:04PM -0500, Jason Merrill wrote: > > > > On Wed, Jan 23, 2019 at 12:57 PM Marek Polacek > > > >

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-25 Thread Marek Polacek
On Fri, Jan 25, 2019 at 10:05:00AM -0500, Jason Merrill wrote: > On 1/24/19 7:17 PM, Marek Polacek wrote: > > On Wed, Jan 23, 2019 at 03:34:04PM -0500, Jason Merrill wrote: > > > On Wed, Jan 23, 2019 at 12:57 PM Marek Polacek wrote: > > > > > > > > On Wed, Jan 23, 2019 at 09:00:36AM -0500, Jason

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-25 Thread Jason Merrill
On 1/24/19 7:17 PM, Marek Polacek wrote: On Wed, Jan 23, 2019 at 03:34:04PM -0500, Jason Merrill wrote: On Wed, Jan 23, 2019 at 12:57 PM Marek Polacek wrote: On Wed, Jan 23, 2019 at 09:00:36AM -0500, Jason Merrill wrote: I was talking about digest_init, not reshape_init. digest_init calls

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-24 Thread Marek Polacek
On Wed, Jan 23, 2019 at 03:34:04PM -0500, Jason Merrill wrote: > On Wed, Jan 23, 2019 at 12:57 PM Marek Polacek wrote: > > > > On Wed, Jan 23, 2019 at 09:00:36AM -0500, Jason Merrill wrote: > > > I was talking about digest_init, not reshape_init. digest_init calls > > >

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-23 Thread Jason Merrill
On Wed, Jan 23, 2019 at 12:57 PM Marek Polacek wrote: > > On Wed, Jan 23, 2019 at 09:00:36AM -0500, Jason Merrill wrote: > > I was talking about digest_init, not reshape_init. digest_init calls > > convert_for_initialization. > > /facepalm > > So yes, digest_init calls convert_for_initialization

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-23 Thread Marek Polacek
On Wed, Jan 23, 2019 at 09:00:36AM -0500, Jason Merrill wrote: > I was talking about digest_init, not reshape_init. digest_init calls > convert_for_initialization. /facepalm So yes, digest_init calls convert_for_initialization which will end up calling perform_implicit_conversion_flags which

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-23 Thread Jason Merrill
On 1/22/19 4:10 PM, Marek Polacek wrote: On Mon, Jan 21, 2019 at 03:14:53PM -0500, Jason Merrill wrote: On 1/18/19 9:12 AM, Marek Polacek wrote: On Thu, Jan 17, 2019 at 04:17:29PM -0500, Jason Merrill wrote: On 1/17/19 2:09 PM, Marek Polacek wrote: This patch ought to fix the rest of 78244,

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-22 Thread Marek Polacek
On Mon, Jan 21, 2019 at 03:14:53PM -0500, Jason Merrill wrote: > On 1/18/19 9:12 AM, Marek Polacek wrote: > > On Thu, Jan 17, 2019 at 04:17:29PM -0500, Jason Merrill wrote: > > > On 1/17/19 2:09 PM, Marek Polacek wrote: > > > > This patch ought to fix the rest of 78244, a missing narrowing warning

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-21 Thread Jason Merrill
On 1/18/19 9:12 AM, Marek Polacek wrote: On Thu, Jan 17, 2019 at 04:17:29PM -0500, Jason Merrill wrote: On 1/17/19 2:09 PM, Marek Polacek wrote: This patch ought to fix the rest of 78244, a missing narrowing warning in decltype. As I explained in Bugzilla, there can be three scenarios: 1)

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-18 Thread Marek Polacek
On Thu, Jan 17, 2019 at 04:17:29PM -0500, Jason Merrill wrote: > On 1/17/19 2:09 PM, Marek Polacek wrote: > > This patch ought to fix the rest of 78244, a missing narrowing warning in > > decltype. > > > > As I explained in Bugzilla, there can be three scenarios: > > > > 1) decltype is in a

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-17 Thread Jason Merrill
On 1/17/19 2:09 PM, Marek Polacek wrote: This patch ought to fix the rest of 78244, a missing narrowing warning in decltype. As I explained in Bugzilla, there can be three scenarios: 1) decltype is in a template and it has no dependent expressions, which is the problematical case.

C++ PATCH for c++/78244 - narrowing conversion in template not detected, part 2

2019-01-17 Thread Marek Polacek
This patch ought to fix the rest of 78244, a missing narrowing warning in decltype. As I explained in Bugzilla, there can be three scenarios: 1) decltype is in a template and it has no dependent expressions, which is the problematical case. finish_compound_literal just returns the compound

Re: C++ PATCH for c++/78244 - narrowing conversion in template not detected

2019-01-16 Thread Jason Merrill
On 1/16/19 7:32 AM, Marek Polacek wrote: While looking into 88815, a 9 regression, I realized we'll have to fix 78244 first. This patch fixes one half of 78244. The problem was that we never detected narrowing conversion in a template, because the IMPLICIT_CONV_EXPR template code doesn't have

C++ PATCH for c++/78244 - narrowing conversion in template not detected

2019-01-16 Thread Marek Polacek
While looking into 88815, a 9 regression, I realized we'll have to fix 78244 first. This patch fixes one half of 78244. The problem was that we never detected narrowing conversion in a template, because the IMPLICIT_CONV_EXPR template code doesn't have the information whether it was initialized