aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2008-09-03 01:00:04 +0000
committerAldy Hernandez <aldyh@redhat.com>2008-09-03 01:00:04 +0000
commitd79273136e041db902845fba1b3a347b18138a04 (patch)
treee8cf01ea25ea102fb71086ca128988be07714307 /gcc/diagnostic.c
parentfaac873ed269e3b5f115b8af4e1121d138fb1b3b (diff)
* diagnostic.c (error_at): New.
* toplev.h (error_at): New prototype. * c-typeck.c (build_array_ref): Call error_at instead of error. Pass location to pedwarn. cp/ * typeck.c (build_array_ref): Use new location argument. * class.c (build_vtbl_ref_1): Pass location to build_array_ref. * call.c (build_new_op): Same. * decl2.c (grok_array_decl): Same. * cp-tree.h (build_array_ref): Add location argument to prototype. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@139924 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 02423fab7df..f323f363ae5 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -598,6 +598,19 @@ error (const char *gmsgid, ...)
va_end (ap);
}
+/* Same as ebove, but use location LOC instead of input_location. */
+void
+error_at (location_t loc, const char *gmsgid, ...)
+{
+ diagnostic_info diagnostic;
+ va_list ap;
+
+ va_start (ap, gmsgid);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, loc, DK_ERROR);
+ report_diagnostic (&diagnostic);
+ va_end (ap);
+}
+
/* "Sorry, not implemented." Use for a language feature which is
required by the relevant specification but not implemented by GCC.
An object file will not be produced. */