diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-06 16:37:06 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2008-08-06 16:37:06 +0000 |
commit | 7e99f74bbbb709c118fef4991219f83e55bc9b98 (patch) | |
tree | 783902cef32fa8d98d51a37c7d2c4cc393628f93 /gcc/diagnostic.c | |
parent | 4eee656926d2ff1d11587c909a828267a5e3f40a (diff) | |
download | gcc-7e99f74bbbb709c118fef4991219f83e55bc9b98.zip gcc-7e99f74bbbb709c118fef4991219f83e55bc9b98.tar.gz gcc-7e99f74bbbb709c118fef4991219f83e55bc9b98.tar.bz2 |
re PR c++/26785 ("extra qualification" error gives line number of end of declaration)
2008-08-06 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 26785
* diagnostic.c (permerror_at): New.
* toplev.h (permerror_at): Declare.
cp/
* decl.c (grokdeclarator): Use explicit location with
permerror_at.
testsuite/
* g++.dg/warn/pr26785.C: New.
From-SVN: r138816
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 49b3f9a..69b7e4b 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -554,10 +554,26 @@ pedwarn0 (const char *gmsgid, ...) va_end (ap); } -/* A "permissive" error: issues an error unless -fpermissive was given - on the command line, in which case it issues a warning. Use this - for things that really should be errors but we want to support - legacy code. */ +/* A "permissive" error at LOCATION: issues an error unless + -fpermissive was given on the command line, in which case it issues + a warning. Use this for things that really should be errors but we + want to support legacy code. */ + +void +permerror_at (location_t location, const char *gmsgid, ...) +{ + diagnostic_info diagnostic; + va_list ap; + + va_start (ap, gmsgid); + diagnostic_set_info (&diagnostic, gmsgid, &ap, location, + permissive_error_kind ()); + diagnostic.option_index = OPT_fpermissive; + report_diagnostic (&diagnostic); + va_end (ap); +} + +/* Equivalent to permerror_at (input_location, ...). */ void permerror (const char *gmsgid, ...) |