diff options
author | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-02 02:50:25 +0000 |
---|---|---|
committer | jsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-03-02 02:50:25 +0000 |
commit | 8dc938b96836b81a9641e3d0815aa1338a99b17c (patch) | |
tree | 87b2d47fdc5b99120fde55ab67dd2c05f1a341b4 /gcc/c-decl.c | |
parent | 35d8b8ba32a7d9dc2d24ca3edf1aaccf2c467c52 (diff) | |
download | gcc-8dc938b96836b81a9641e3d0815aa1338a99b17c.tar.gz |
PR c/8927
* c-tree.h (undeclared_variable, build_external_ref): Add extra
argument.
* c-decl.c (undeclared_variable): Take location as argument.
* c-typeck.c (build_external_ref): Likewise.
* c-parser.c (c_parser_postfix_expression): Pass location of
identifier to build_external_ref.
testsuite:
* gcc.dg/pr8927-1.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95773 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 690d3b3bc80..5cad16ee69f 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -2312,26 +2312,26 @@ implicitly_declare (tree functionid) ID, including a reference to a builtin outside of function-call context. Establish a binding of the identifier to error_mark_node in an appropriate scope, which will suppress further errors for the - same identifier. */ + same identifier. The error message should be given location LOC. */ void -undeclared_variable (tree id) +undeclared_variable (tree id, location_t loc) { static bool already = false; struct c_scope *scope; if (current_function_decl == 0) { - error ("%qE undeclared here (not in a function)", id); + error ("%H%qE undeclared here (not in a function)", &loc, id); scope = current_scope; } else { - error ("%qE undeclared (first use in this function)", id); + error ("%H%qE undeclared (first use in this function)", &loc, id); if (!already) { - error ("(Each undeclared identifier is reported only once"); - error ("for each function it appears in.)"); + error ("%H(Each undeclared identifier is reported only once", &loc); + error ("%Hfor each function it appears in.)", &loc); already = true; } |