Re: [C++ Patch] More location fixes to grokdeclarator

2018-07-03 Thread Jason Merrill
OK. On Tue, Jul 3, 2018 at 2:37 PM, Paolo Carlini wrote: > Hi, > > On 03/07/2018 18:36, Jason Merrill wrote: >> >> >>> if ((type_quals & TYPE_QUAL_VOLATILE) >>> - && (loc == UNKNOWN_LOCATION || locations[ds_volatile] < loc)) >>> + && (loc == UNKNOWN_LOCATION >>> + || linema

Re: [C++ Patch] More location fixes to grokdeclarator

2018-07-03 Thread Paolo Carlini
Hi, On 03/07/2018 18:36, Jason Merrill wrote: if ((type_quals & TYPE_QUAL_VOLATILE) - && (loc == UNKNOWN_LOCATION || locations[ds_volatile] < loc)) + && (loc == UNKNOWN_LOCATION + || linemap_location_before_p (line_table, +location

Re: [C++ Patch] More location fixes to grokdeclarator

2018-07-03 Thread Jason Merrill
On Thu, Jun 28, 2018 at 5:39 AM, Paolo Carlini wrote: > Hi, > > On 28/06/2018 03:22, David Malcolm wrote: >> >> [snip] >>> >>> If I'm following you right, the idea is that gcc should complain >>> because two different things in the user's source code contradict >>> each >>> other. >>> >>> In such

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-28 Thread Paolo Carlini
Hi, On 28/06/2018 03:22, David Malcolm wrote: [snip] If I'm following you right, the idea is that gcc should complain because two different things in the user's source code contradict each other. In such circumstances, I think we ought to try to print *both* locations, so that we're showing, r

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread David Malcolm
On Wed, 2018-06-27 at 21:13 -0400, David Malcolm wrote: > On Thu, 2018-06-28 at 02:28 +0200, Paolo Carlini wrote: > > Hi, > > > > On 28/06/2018 01:31, Jason Merrill wrote: > > > > > > > +/* Returns the smallest location. */ > > > > > > This should probably say "...that is not UNKNOWN_LOCATION."

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread David Malcolm
On Thu, 2018-06-28 at 02:28 +0200, Paolo Carlini wrote: > Hi, > > On 28/06/2018 01:31, Jason Merrill wrote: > > > > > +/* Returns the smallest location. */ > > > > This should probably say "...that is not UNKNOWN_LOCATION." > > I agree. > > Actually, the places you use min_location would seem

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread Paolo Carlini
Hi, On 28/06/2018 01:31, Jason Merrill wrote: +/* Returns the smallest location. */ This should probably say "...that is not UNKNOWN_LOCATION." I agree. Actually, the places you use min_location would seem to work fine with max_location as well. What are your criteria for choosing one or

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread Jason Merrill
On Wed, Jun 27, 2018 at 5:11 AM, Paolo Carlini wrote: > Hi David, > > On 27/06/2018 01:52, David Malcolm wrote: >> >> On Tue, 2018-06-26 at 01:44 +0200, Paolo Carlini wrote: >>> >>> Hi, >>> >>> this includes straightforward tweaks to check_concept_fn and quite a >>> bit >>> of additional work on g

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-27 Thread Paolo Carlini
Hi David, On 27/06/2018 01:52, David Malcolm wrote: On Tue, 2018-06-26 at 01:44 +0200, Paolo Carlini wrote: Hi, this includes straightforward tweaks to check_concept_fn and quite a bit of additional work on grokdeclarator: most of it is also rather straightforward. In a few places there is the

Re: [C++ Patch] More location fixes to grokdeclarator

2018-06-26 Thread David Malcolm
On Tue, 2018-06-26 at 01:44 +0200, Paolo Carlini wrote: > Hi, > > this includes straightforward tweaks to check_concept_fn and quite a > bit > of additional work on grokdeclarator: most of it is also rather > straightforward. In a few places there is the subtlety that we want > to > handle toge

[C++ Patch] More location fixes to grokdeclarator

2018-06-25 Thread Paolo Carlini
Hi, this includes straightforward tweaks to check_concept_fn and quite a bit of additional work on grokdeclarator: most of it is also rather straightforward. In a few places there is the subtlety that we want to handle together ds_storage_class and ds_thread, whichever location is the smalles