Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-02 Thread Marek Polacek
On Fri, Mar 02, 2018 at 01:17:55PM -0500, Jason Merrill wrote: > Actually, this is redundant; an expression can only be dependent if > processing_template_decl. I'll fix. Ah, that makes a lot of sense. Thanks, Marek

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-02 Thread Jason Merrill
On Mar 1, 2018 4:57 PM, "Jason Merrill" wrote: > Ok. > > On Mar 1, 2018 4:40 PM, "Marek Polacek" wrote: > >> On Thu, Mar 01, 2018 at 01:56:50PM -0500, Jason Merrill wrote: >> > On Thu, Mar 1, 2018 at 8:17 AM, Marek Polacek >> wrote: >> > > On Wed, Feb 28, 2018 at 04:50:39PM -0500, Jason Merrill

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-01 Thread Jason Merrill
Ok. On Mar 1, 2018 4:40 PM, "Marek Polacek" wrote: > On Thu, Mar 01, 2018 at 01:56:50PM -0500, Jason Merrill wrote: > > On Thu, Mar 1, 2018 at 8:17 AM, Marek Polacek > wrote: > > > On Wed, Feb 28, 2018 at 04:50:39PM -0500, Jason Merrill wrote: > > >> On Wed, Feb 28, 2018 at 4:19 PM, Marek Polac

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-01 Thread Marek Polacek
On Thu, Mar 01, 2018 at 01:56:50PM -0500, Jason Merrill wrote: > On Thu, Mar 1, 2018 at 8:17 AM, Marek Polacek wrote: > > On Wed, Feb 28, 2018 at 04:50:39PM -0500, Jason Merrill wrote: > >> On Wed, Feb 28, 2018 at 4:19 PM, Marek Polacek wrote: > >> > On Wed, Feb 28, 2018 at 10:51:17AM -0500, Jaso

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-01 Thread Jason Merrill
On Thu, Mar 1, 2018 at 8:17 AM, Marek Polacek wrote: > On Wed, Feb 28, 2018 at 04:50:39PM -0500, Jason Merrill wrote: >> On Wed, Feb 28, 2018 at 4:19 PM, Marek Polacek wrote: >> > On Wed, Feb 28, 2018 at 10:51:17AM -0500, Jason Merrill wrote: >> >> On Wed, Feb 28, 2018 at 9:32 AM, Marek Polacek

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-03-01 Thread Marek Polacek
On Wed, Feb 28, 2018 at 04:50:39PM -0500, Jason Merrill wrote: > On Wed, Feb 28, 2018 at 4:19 PM, Marek Polacek wrote: > > On Wed, Feb 28, 2018 at 10:51:17AM -0500, Jason Merrill wrote: > >> On Wed, Feb 28, 2018 at 9:32 AM, Marek Polacek wrote: > >> > On Tue, Feb 27, 2018 at 04:16:31PM -0500, Jas

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-28 Thread Jason Merrill
On Wed, Feb 28, 2018 at 4:19 PM, Marek Polacek wrote: > On Wed, Feb 28, 2018 at 10:51:17AM -0500, Jason Merrill wrote: >> On Wed, Feb 28, 2018 at 9:32 AM, Marek Polacek wrote: >> > On Tue, Feb 27, 2018 at 04:16:31PM -0500, Jason Merrill wrote: >> >> On 02/27/2018 02:13 PM, Marek Polacek wrote: >>

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-28 Thread Marek Polacek
On Wed, Feb 28, 2018 at 10:51:17AM -0500, Jason Merrill wrote: > On Wed, Feb 28, 2018 at 9:32 AM, Marek Polacek wrote: > > On Tue, Feb 27, 2018 at 04:16:31PM -0500, Jason Merrill wrote: > >> On 02/27/2018 02:13 PM, Marek Polacek wrote: > >> > My recent change introducing cxx_constant_init caused t

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-28 Thread Jason Merrill
On Wed, Feb 28, 2018 at 9:32 AM, Marek Polacek wrote: > On Tue, Feb 27, 2018 at 04:16:31PM -0500, Jason Merrill wrote: >> On 02/27/2018 02:13 PM, Marek Polacek wrote: >> > My recent change introducing cxx_constant_init caused this code >> > >> > template class A { >> >static const long b = 0;

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-28 Thread Marek Polacek
On Tue, Feb 27, 2018 at 04:16:31PM -0500, Jason Merrill wrote: > On 02/27/2018 02:13 PM, Marek Polacek wrote: > > My recent change introducing cxx_constant_init caused this code > > > > template class A { > >static const long b = 0; > >static const unsigned c = (b); > > }; > > > > to be

Re: C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-27 Thread Jason Merrill
On 02/27/2018 02:13 PM, Marek Polacek wrote: My recent change introducing cxx_constant_init caused this code template class A { static const long b = 0; static const unsigned c = (b); }; to be rejected. The reason is that force_paren_expr turns "b" into "*(const long int &) &b", where t

C++ PATCH to fix static init with () in a template (PR c++/84582)

2018-02-27 Thread Marek Polacek
My recent change introducing cxx_constant_init caused this code template class A { static const long b = 0; static const unsigned c = (b); }; to be rejected. The reason is that force_paren_expr turns "b" into "*(const long int &) &b", where the former is not value-dependent but the latter i