Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-08 Thread Jason Merrill
On 01/08/2018 04:49 PM, Jason Merrill wrote: On 01/08/2018 04:01 PM, David Malcolm wrote: On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: I'd rather handle location wrappers separately, and abort if VIEW_CONVERT_EXPR or NON_LVALUE_EXPR appear other than as wrappers. Once I fixed the

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-08 Thread Jason Merrill
On 01/08/2018 04:01 PM, David Malcolm wrote: On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: I'd rather handle location wrappers separately, and abort if VIEW_CONVERT_EXPR or NON_LVALUE_EXPR appear other than as wrappers. Once I fixed the issue with location_wrapper_p with decls

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-08 Thread Jason Merrill
On 01/05/2018 05:20 PM, David Malcolm wrote: On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: On 12/29/2017 12:06 PM, David Malcolm wrote: @@ -24998,6 +25018,8 @@ build_non_dependent_expr (tree expr) && !expanding_concept ()) fold_non_dependent_expr (expr); +

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-08 Thread David Malcolm
On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > On 12/29/2017 12:06 PM, David Malcolm wrote: > > One issue I ran into was that fold_for_warn doesn't eliminate > > location wrappers when processing_template_decl, leading to > > failures of the template-based cases in > >

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread Jakub Jelinek
On Mon, Jan 08, 2018 at 01:02:37PM -0500, David Malcolm wrote: > Thanks Nathan and Jakub: a quick smoketest using TREE_LANG_FLAG_0 > worked, and fixes this issue. > > However, should I be using a TREE_LANG_FLAG for something that's in > tree.h/c, rather than just in the "cp" subdir? (the wrapper

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread David Malcolm
On Mon, 2018-01-08 at 12:25 -0500, Nathan Sidwell wrote: > On 01/08/2018 12:14 PM, Jakub Jelinek wrote: > > On Mon, Jan 08, 2018 at 12:10:50PM -0500, Nathan Sidwell wrote: > > > > Both "_S_terminal" VAR_DECLs have a "_CharT" > > > > TEMPLATE_TYPE_PARM, but > > > > these types are different tree

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread Nathan Sidwell
On 01/08/2018 12:14 PM, Jakub Jelinek wrote: On Mon, Jan 08, 2018 at 12:10:50PM -0500, Nathan Sidwell wrote: Both "_S_terminal" VAR_DECLs have a "_CharT" TEMPLATE_TYPE_PARM, but these types are different tree nodes. correct. they are not EQ but are EQUAL (same_type_p will be true). So

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread Jakub Jelinek
On Mon, Jan 08, 2018 at 12:10:50PM -0500, Nathan Sidwell wrote: > > Both "_S_terminal" VAR_DECLs have a "_CharT" TEMPLATE_TYPE_PARM, but > > these types are different tree nodes. > > correct. they are not EQ but are EQUAL (same_type_p will be true). So perhaps location_wrapper_p could use that

Re: Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread Nathan Sidwell
On 01/08/2018 12:02 PM, David Malcolm wrote: On Fri, 2018-01-05 at 17:20 -0500, David Malcolm wrote: Doing so uncovered an issue which I'm not sure how to resolve: it's possible for a decl to change type during parsing, after location wrappers may have been created, which changes

Location wrappers vs decls that change type (was Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl))

2018-01-08 Thread David Malcolm
On Fri, 2018-01-05 at 17:20 -0500, David Malcolm wrote: > On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > > On 12/29/2017 12:06 PM, David Malcolm wrote: > > > One issue I ran into was that fold_for_warn doesn't eliminate > > > location wrappers when processing_template_decl, leading to >

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-05 Thread David Malcolm
On Fri, 2018-01-05 at 15:29 -0500, Jason Merrill wrote: > On 12/29/2017 12:06 PM, David Malcolm wrote: > > One issue I ran into was that fold_for_warn doesn't eliminate > > location wrappers when processing_template_decl, leading to > > failures of the template-based cases in > >

Re: [v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2018-01-05 Thread Jason Merrill
On 12/29/2017 12:06 PM, David Malcolm wrote: One issue I ran into was that fold_for_warn doesn't eliminate location wrappers when processing_template_decl, leading to failures of the template-based cases in g++.dg/warn/Wmemset-transposed-args-1.C. This is due to the early bailout when

[v2 of PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-29 Thread David Malcolm
On Fri, 2017-12-15 at 13:58 -0500, Jason Merrill wrote: > On Fri, Dec 15, 2017 at 11:35 AM, David Malcolm > wrote: > > On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: > > > On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm > > om> > > > wrote: > > >

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread David Malcolm
On Fri, 2017-12-15 at 13:58 -0500, Jason Merrill wrote: > On Fri, Dec 15, 2017 at 11:35 AM, David Malcolm > wrote: > > On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: > > > On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm > > om> > > > wrote: > > >

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread Jason Merrill
On Fri, Dec 15, 2017 at 11:35 AM, David Malcolm wrote: > On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: >> On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm >> wrote: >> > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: >> > > On 11/10/2017

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread David Malcolm
On Fri, 2017-12-15 at 10:01 -0500, Jason Merrill wrote: > On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm > wrote: > > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: > > > On 11/10/2017 04:45 PM, David Malcolm wrote: > > > > The initial version of the patch kit added

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-15 Thread Jason Merrill
On Thu, Dec 14, 2017 at 2:25 PM, David Malcolm wrote: > On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: >> On 11/10/2017 04:45 PM, David Malcolm wrote: >> > The initial version of the patch kit added location wrapper nodes >> > around constants and

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-14 Thread David Malcolm
On Mon, 2017-12-11 at 21:10 -0500, Jason Merrill wrote: > On 11/10/2017 04:45 PM, David Malcolm wrote: > > The initial version of the patch kit added location wrapper nodes > > around constants and uses-of-declarations, along with some other > > places in the parser (typeid, alignof, sizeof,

Re: [PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-12-11 Thread Jason Merrill
On 11/10/2017 04:45 PM, David Malcolm wrote: The initial version of the patch kit added location wrapper nodes around constants and uses-of-declarations, along with some other places in the parser (typeid, alignof, sizeof, offsetof). This version takes a much more minimal approach: it only adds

[PATCH 03/14] C++: add location_t wrapper nodes during parsing (minimal impl)

2017-11-10 Thread David Malcolm
The initial version of the patch kit added location wrapper nodes around constants and uses-of-declarations, along with some other places in the parser (typeid, alignof, sizeof, offsetof). This version takes a much more minimal approach: it only adds location wrapper nodes around the arguments at