g++.old-deja/g++.other/anon7.C
Per Bothner
pbothner@apple.com
Thu Jul 24 07:21:00 GMT 2003
Mark Mitchell wrote:
> This test seems to be emitting extra, invalid, errors in the wake of
> these patches:
>
> 2003-07-22 Per Bothner <pbothner@apple.com>
>
> * line-map.c (add_line_map): Handle invalid LEAVE request.
> Fixes PR preprocessor/11361.
>
> 2003-07-22 Per Bothner <pbothner@apple.com>
>
> * diagnostic.c.(diagnostic_report_current_module): Update to match
> 2003-06-05 changes to push_srcloc and pop_srcloc.
>
> Would you mind taking a look to see if you can see what's going on
> there?
What's happening is that pushdecl_class_level is calling push_srcloc and
pop_srcloc which add the pushed DECL_SOURCE_FILE and _LINE to the
#include file stack used for diagnostics. My patch fixes the
diagnostics code, so the entire include file stack is shown.
My June 6 change caused part of the include file stack to not get
printed in error messages. Before that anon7.C should get spurious
error messages, because diagnotic.C was misusing push_srcloc/pop_srcloc.
So you edited the test case on June 20 to "Remove spurious error
messages" because we were no longer getting them. And now they're back.
So you have to decide: What error messages do you want? If you don't
want the "spurious errors" don't use push_srcloc/pop_srcloc. I suggest
replacing the calls by:
location_t save_location = input_location;
input_location = DECL_SOURCE_LOCATION (f);
...
input_location = save_location;
--
--Per Bothner
per@bothner.com pbothner@apple.com http://per.bothner.com/
More information about the Gcc
mailing list