On Wed, Mar 04, 2026 at 03:21:26PM -0500, Jason Merrill wrote:
> On 3/4/26 2:35 PM, Boris Staletic wrote:
> > Bootstrapped and tested on tested on x86_64-pc-linux-gnu.
> > For the patch I did run the entire `make check`.
> >
> > I don't think the error message is great,
> > but I'm not sure how to improve it.
> > I did try `%D` to format the scope as well,
> > but that fails when the reflected entity has TU scope.
>
> No need, I think; for decls outside the global namespace printing the
> spliced decl will print its scope without needing to repeat it. But let's
> use %q#D instead of %<%D%>, 'q' to add quotes and # to add decl-specifiers.
> And you might add
>
> inform (DECL_SOURCE_LOCATION (decl), "declared here");
>
> after the error.
But in that case also
auto_diagnostic_group d;
to group error and inform together.
Jakub