Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-07 Thread Jason Merrill via Gcc-patches
On 7/7/21 4:23 AM, Matthias Kretz wrote: On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: 2. About the namespace aliases: IIUC an attribute would currently be rejected because of the C++ grammar. Do you want to make it valid before WG21 officially decides how to proceed? And if you

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-07 Thread Jason Merrill via Gcc-patches
On 7/5/21 10:18 AM, Matthias Kretz wrote: On Thursday, 1 July 2021 17:18:26 CEST Jason Merrill wrote: You probably want to adjust is_late_template_attribute to change that. Right, I hacked is_late_template_attribute but now I only see a TYPE_DECL passed to my attribute handler

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-07 Thread Matthias Kretz
On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: > > 2. About the namespace aliases: IIUC an attribute would currently be > > rejected because of the C++ grammar. Do you want to make it valid before > > WG21 officially decides how to proceed? And if you have a pointer for me > > where

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-05 Thread Matthias Kretz
On Thursday, 1 July 2021 17:18:26 CEST Jason Merrill wrote: > You probably want to adjust is_late_template_attribute to change that. Right, I hacked is_late_template_attribute but now I only see a TYPE_DECL passed to my attribute handler (!DECL_ALIAS_TEMPLATE_P). I.e. I don't know how your

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-01 Thread Jason Merrill via Gcc-patches
On 7/1/21 5:28 AM, Matthias Kretz wrote: On Tuesday, 22 June 2021 22:12:42 CEST Jason Merrill wrote: On 6/22/21 4:01 PM, Matthias Kretz wrote: On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: For alias templates, you probably want the attribute only on the templated class, not on

Re: [PATCH] Add gnu::diagnose_as attribute

2021-07-01 Thread Matthias Kretz
On Tuesday, 22 June 2021 22:12:42 CEST Jason Merrill wrote: > On 6/22/21 4:01 PM, Matthias Kretz wrote: > > On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: > >> For alias templates, you probably want the attribute only on the > >> templated class, not on the instantiations. > > > > Oh

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Jason Merrill via Gcc-patches
On 6/22/21 4:01 PM, Matthias Kretz wrote: On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: For alias templates, you probably want the attribute only on the templated class, not on the instantiations. Oh good point. My current patch does not allow the attribute on alias templates.

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Matthias Kretz
On Tuesday, 22 June 2021 21:52:16 CEST Jason Merrill wrote: > For alias templates, you probably want the attribute only on the > templated class, not on the instantiations. Oh good point. My current patch does not allow the attribute on alias templates. Consider: template struct X {};

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Jason Merrill via Gcc-patches
On 6/22/21 3:30 AM, Matthias Kretz wrote: On Wednesday, 16 June 2021 02:48:09 CEST Jason Merrill wrote: IIUC, your main concern is that my proposed diagnose_as *can* be used to make diagnostics worse, by replacing names with strings that are not valid identifiers. Of course, whoever uses the

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-22 Thread Matthias Kretz
On Wednesday, 16 June 2021 02:48:09 CEST Jason Merrill wrote: > > IIUC, your main concern is that my proposed diagnose_as *can* be used to > > make diagnostics worse, by replacing names with strings that are not > > valid identifiers. Of course, whoever uses the attribute to that effect > > should

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-15 Thread Jason Merrill via Gcc-patches
On 6/15/21 4:56 PM, Matthias Kretz wrote: On Tuesday, 15 June 2021 17:51:20 CEST Jason Merrill wrote: On 6/11/21 6:01 AM, Matthias Kretz wrote: For reference I'll attach my stdx::simd diagnose_as patch. We could also talk about extending the feature to provide more information about the

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-15 Thread Matthias Kretz
On Tuesday, 15 June 2021 17:51:20 CEST Jason Merrill wrote: > On 6/11/21 6:01 AM, Matthias Kretz wrote: > > For reference I'll attach my stdx::simd diagnose_as patch. > > > > We could also talk about extending the feature to provide more information > > about the diagnose_as substition. E.g.

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-15 Thread Jason Merrill via Gcc-patches
On 6/11/21 6:01 AM, Matthias Kretz wrote: How can we make progress here? I could try to produce some "Tony Tables" of diagnostic output of my modified stdx::simd. I believe it's a major productivity boost to see abbreviated / "obfuscated" diagnostics *out-of-the box* (with the possibility to

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-11 Thread Matthias Kretz
How can we make progress here? I could try to produce some "Tony Tables" of diagnostic output of my modified stdx::simd. I believe it's a major productivity boost to see abbreviated / "obfuscated" diagnostics *out-of-the box* (with the possibility to opt-out). Actually, it already *is* a

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-01 Thread Matthias Kretz
On Tuesday, 1 June 2021 21:12:18 CEST Jason Merrill wrote: > On 5/28/21 3:42 AM, Matthias Kretz wrote: > > On Friday, 28 May 2021 05:05:52 CEST Jason Merrill wrote: > >> I'd think you could get the same effect from a hypothetical > >> > >> namespace [[gnu::diagnose_as]] stdx = std::experimental;

Re: [PATCH] Add gnu::diagnose_as attribute

2021-06-01 Thread Jason Merrill via Gcc-patches
On 5/28/21 3:42 AM, Matthias Kretz wrote: On Friday, 28 May 2021 05:05:52 CEST Jason Merrill wrote: On 5/27/21 6:07 PM, Matthias Kretz wrote: On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: On 5/27/21 2:54 PM, Matthias Kretz wrote: namespace Vir { inline namespace foo {

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-28 Thread Matthias Kretz
On Friday, 28 May 2021 05:05:52 CEST Jason Merrill wrote: > On 5/27/21 6:07 PM, Matthias Kretz wrote: > > On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: > >> On 5/27/21 2:54 PM, Matthias Kretz wrote: > >>> namespace Vir { > >>> inline namespace foo { > >>> struct A {}; > >>>

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Jason Merrill via Gcc-patches
On 5/27/21 6:07 PM, Matthias Kretz wrote: On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: On 5/27/21 2:54 PM, Matthias Kretz wrote: Also hiding all inline namespace by default might make some error messages harder to understand: namespace Vir { inline namespace foo {

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Matthias Kretz
On Thursday, 27 May 2021 23:15:46 CEST Jason Merrill wrote: > On 5/27/21 2:54 PM, Matthias Kretz wrote: > > Also hiding all inline namespace by default might make some error messages > > harder to understand: > > > > namespace Vir { > >inline namespace foo { > > struct A {}; > >} > >

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Jason Merrill via Gcc-patches
On 5/27/21 2:54 PM, Matthias Kretz wrote: On Thursday, 27 May 2021 19:39:48 CEST Jason Merrill wrote: On 5/4/21 7:13 AM, Matthias Kretz wrote: From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Matthias Kretz
On Thursday, 27 May 2021 19:39:48 CEST Jason Merrill wrote: > On 5/4/21 7:13 AM, Matthias Kretz wrote: > > From: Matthias Kretz > > > > This attribute overrides the diagnostics output string for the entity it > > appertains to. The motivation is to improve QoI for library TS > > implementations,

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-27 Thread Jason Merrill via Gcc-patches
On 5/4/21 7:13 AM, Matthias Kretz wrote: From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for library TS implementations, where diagnostics have a very bad signal-to-noise ratio due to the long

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-26 Thread Matthias Kretz
On Friday, 14 May 2021 18:05:03 CEST Martin Sebor wrote: > [...] > > At the same time, my concern with adding another syntactic renaming > mechanism that's specifically intended to change symbol names in > diagnostics (and the two macros) but nowhere else is that it would > considerably raise the

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-14 Thread Martin Sebor via Gcc-patches
On 5/4/21 5:13 AM, Matthias Kretz wrote: From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for library TS implementations, where diagnostics have a very bad signal-to-noise ratio due to the long

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
> On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > > Does the patch interact correctly with the %H and %I codes that try to > > show the differences between two template types? While looking into this, I noticed that given namespace std { struct A {}; typedef A B; } const std::B

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread David Malcolm via Gcc-patches
On Tue, 2021-05-04 at 16:23 +0200, Matthias Kretz wrote: > On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > > On Tue, 2021-05-04 at 13:13 +0200, Matthias Kretz wrote: > > > This attribute overrides the diagnostics output string for the > > > entity > > > it > > > appertains to. The

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
On Tuesday, 4 May 2021 16:23:23 CEST Matthias Kretz wrote: > On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > > Does the patch interact correctly with the %H and %I codes that try to > > show the differences between two template types? > > I don't know. I'll try to find out. If you

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
On Tuesday, 4 May 2021 15:34:13 CEST David Malcolm wrote: > On Tue, 2021-05-04 at 13:13 +0200, Matthias Kretz wrote: > > This attribute overrides the diagnostics output string for the entity > > it > > appertains to. The motivation is to improve QoI for library TS > > implementations, where

Re: [PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread David Malcolm via Gcc-patches
On Tue, 2021-05-04 at 13:13 +0200, Matthias Kretz wrote: > From: Matthias Kretz > > This attribute overrides the diagnostics output string for the entity > it > appertains to. The motivation is to improve QoI for library TS > implementations, where diagnostics have a very bad signal-to-noise >

[PATCH] Add gnu::diagnose_as attribute

2021-05-04 Thread Matthias Kretz
From: Matthias Kretz This attribute overrides the diagnostics output string for the entity it appertains to. The motivation is to improve QoI for library TS implementations, where diagnostics have a very bad signal-to-noise ratio due to the long namespaces involved. On Tuesday, 27 April 2021