aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-typeck.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-03-02 02:50:25 +0000
committerJoseph Myers <jsm28@gcc.gnu.org>2005-03-02 02:50:25 +0000
commit766beb4020b7f8aa11cbff2fc40cf01f5e36b7c8 (patch)
tree87b2d47fdc5b99120fde55ab67dd2c05f1a341b4 /gcc/c-typeck.c
parent176a0aad11289b39ab49dda6abc94b69de7fe68d (diff)
downloadgcc-766beb4020b7f8aa11cbff2fc40cf01f5e36b7c8.zip
gcc-766beb4020b7f8aa11cbff2fc40cf01f5e36b7c8.tar.gz
gcc-766beb4020b7f8aa11cbff2fc40cf01f5e36b7c8.tar.bz2
re PR c/8927 (Gcc give error for wrong line of C code.)
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. From-SVN: r95773
Diffstat (limited to 'gcc/c-typeck.c')
-rw-r--r--gcc/c-typeck.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 3a38d22..ea1c81c 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1787,9 +1787,10 @@ build_array_ref (tree array, tree index)
}
/* Build an external reference to identifier ID. FUN indicates
- whether this will be used for a function call. */
+ whether this will be used for a function call. LOC is the source
+ location of the identifier. */
tree
-build_external_ref (tree id, int fun)
+build_external_ref (tree id, int fun, location_t loc)
{
tree ref;
tree decl = lookup_name (id);
@@ -1809,7 +1810,7 @@ build_external_ref (tree id, int fun)
return error_mark_node;
else
{
- undeclared_variable (id);
+ undeclared_variable (id, loc);
return error_mark_node;
}