Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-27 Thread Nathan Sidwell
On 03/27/2018 03:08 AM, Volker Reichelt wrote: On 03/26/2018 01:19 PM, Nathan Sidwell wrote: On 03/25/2018 10:18 AM, Volker Reichelt wrote: How about the following then? I rephrased the last three errors a little to really make them stand-alone errors. Again, bootstrapped and regtested. O

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-27 Thread Volker Reichelt
On 03/26/2018 01:19 PM, Nathan Sidwell wrote: On 03/25/2018 10:18 AM, Volker Reichelt wrote: Index: gcc/cp/search.c === --- gcc/cp/search.c    (revision 258835) +++ gcc/cp/search.c    (working copy) @@ -1918,12 +1918,14 @@    

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-26 Thread Nathan Sidwell
On 03/25/2018 10:18 AM, Volker Reichelt wrote: Index: gcc/cp/search.c === --- gcc/cp/search.c    (revision 258835) +++ gcc/cp/search.c    (working copy) @@ -1918,12 +1918,14 @@    if (fail == 1) {   error ("invalid

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-25 Thread Volker Reichelt
On 03/25/2018 08:48 PM, Paolo Carlini wrote: Hi Volker On 25 Mar 2018, at 16:18, Volker Reichelt wrote: Hi, when overriding a virtual function fails, the C++ front-end usually emits two errors: one for the override that fails and one for the function that is overridden. The second error is c

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-25 Thread Paolo Carlini
On 25/03/2018 21:08, Paolo Carlini wrote: ... oh, please also double check that with 'F' you don't need the general location_of instead of D_S_L, which normally goes with 'D' - I don't have my machines at hand to do it myself, sorry. Just checked, DECL_SOURCE_LOCATION is fine. Paolo.

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-25 Thread Paolo Carlini
... oh, please also double check that with 'F' you don't need the general location_of instead of D_S_L, which normally goes with 'D' - I don't have my machines at hand to do it myself, sorry. Paolo

Re: [C++ Patch] Fix confusing diagnostics for invalid overrides

2018-03-25 Thread Paolo Carlini
Hi Volker > On 25 Mar 2018, at 16:18, Volker Reichelt wrote: > > Hi, > > when overriding a virtual function fails, the C++ front-end usually > emits two errors: one for the override that fails and one for the > function that is overridden. The second error is confusing and > should be replaced