This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] More location fixes to grokdeclarator
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Tue, 26 Jun 2018 19:52:53 -0400
- Subject: Re: [C++ Patch] More location fixes to grokdeclarator
- References: <67f2fc3d-020c-96b7-3176-2c8a8687c758@oracle.com>
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 together ds_storage_class and ds_thread, whichever location
> is
> the smallest but != UNKNOWN_LOCATION (UNKNWON_LOCATION meaning that
> the
> issue is with the other one) or use the biggest location when say
> ds_virtual and ds_storage_class conflict, because - I believe - we
> want
> to point to the place where we give up. Thus I added the
> min_location
> and max_location helpers.
Note that directly comparing location_t values can be problematic: (one
value might be an ad-hoc location, and the other not; one might be a
macro expansion, etc).
You might want to use linemap_compare_locations or
linemap_location_before_p for this.
Hope this is helpful
Dave