[C++ PATCH] __builtin_source_location ()

Jakub Jelinek jakub@redhat.com
Fri Nov 15 14:26:00 GMT 2019


On Fri, Nov 15, 2019 at 09:04:17AM -0500, David Malcolm wrote:
> > +/* Helper of fold_builtin_source_location, return the
> > +   std::source_location::__impl type after performing verification
> > +   on it.  */
> > +
> > +static tree
> > +get_source_location_impl (location_t loc)
> > +{
> 
> FWIW, I found this function confusing at first, and wondered what the
> purpose of LOC was (given that the function is building a type, rather
> than an instance of that type).
> 
> Maybe add this to the leading comment:
>   "LOC is used for reporting any errors."
> (and if so, perhaps replace the various "error" with "error_at", though
> that's rather academic).
> 
> Maybe rename the function to "get_source_location_impl_type" to
> emphasize the distinction?

Consider it done.

	Jakub



More information about the Gcc-patches mailing list