Re: C++ PATCH for c++/85883, class tmpl args deduction fail with new

2018-05-29 Thread Jason Merrill
OK. On Tue, May 29, 2018 at 11:55 AM, Marek Polacek wrote: > On Fri, May 25, 2018 at 01:58:53PM -0400, Jason Merrill wrote: >> > + /* For the rest, e.g. new A(1, 2, 3), create a list. */ >> > + else if (len > 1) >> > + { >> > + unsigned int n; >> > +

Re: C++ PATCH for c++/85883, class tmpl args deduction fail with new

2018-05-29 Thread Marek Polacek
On Fri, May 25, 2018 at 01:58:53PM -0400, Jason Merrill wrote: > > + /* For the rest, e.g. new A(1, 2, 3), create a list. */ > > + else if (len > 1) > > + { > > + unsigned int n; > > + tree t; > > + FOR_EACH_VEC_ELT (**init, n, t) > >

Re: C++ PATCH for c++/85883, class tmpl args deduction fail with new

2018-05-25 Thread Jason Merrill
On Thu, May 24, 2018 at 4:10 PM, Marek Polacek wrote: > Here we were failing to deduce template arguments for a class, because the > code in build_new only handled the case when INIT had 1 element. That works > for e.g. new auto (foo) or new Foo{1, 2}, but not new Foo(1, 2).

C++ PATCH for c++/85883, class tmpl args deduction fail with new

2018-05-24 Thread Marek Polacek
Here we were failing to deduce template arguments for a class, because the code in build_new only handled the case when INIT had 1 element. That works for e.g. new auto (foo) or new Foo{1, 2}, but not new Foo(1, 2). I noticed that it works without "new" because we simply create a tree list of