summaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-05 14:51:20 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-05 14:51:20 +0000
commitfdd84b7783f76d97ff61ab35d967499326f77558 (patch)
treec6fc2880160c7b40280f2a22134ddb900dd3730f /gcc/c-family
parentf83f3c44839c803bdd52d17d475b81be2e2bb1eb (diff)
downloadgcc-fdd84b7783f76d97ff61ab35d967499326f77558.tar.gz
gcc
* c-parser.c (c_parser_omp_atomic): Pass location of assignment operator to c_finish_omp_atomic. * c-typeck.c (lvalue_or_else): Add 'loc' argument. (build_unary_op): Update. (build_modify_expr): Update. (build_asm_expr): Update. gcc/cp * typeck.c (cp_build_addr_expr_1): Update call to lvalue_error. (lvalue_or_else): Likewise. gcc/c-family * c-common.h (lvalue_error): Update. * c-common.c (lvalue_error): Add 'loc' argument. Call error_at, not error. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168514 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-common.c17
-rw-r--r--gcc/c-family/c-common.h4
3 files changed, 17 insertions, 10 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index bf0bc7689f7..668524415b9 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2011-01-05 Tom Tromey <tromey@redhat.com>
+
+ * c-common.h (lvalue_error): Update.
+ * c-common.c (lvalue_error): Add 'loc' argument. Call error_at,
+ not error.
+
2010-12-29 Nicola Pero <nicola@nicola.brainstorm.co.uk>
PR objc/47075
diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index 8eb849aa174..4af7ef4ee4e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -1,6 +1,6 @@
/* Subroutines shared by all languages that are variants of C.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -8631,27 +8631,28 @@ readonly_error (tree arg, enum lvalue_use use)
}
/* Print an error message for an invalid lvalue. USE says
- how the lvalue is being used and so selects the error message. */
+ how the lvalue is being used and so selects the error message. LOC
+ is the location for the error. */
void
-lvalue_error (enum lvalue_use use)
+lvalue_error (location_t loc, enum lvalue_use use)
{
switch (use)
{
case lv_assign:
- error ("lvalue required as left operand of assignment");
+ error_at (loc, "lvalue required as left operand of assignment");
break;
case lv_increment:
- error ("lvalue required as increment operand");
+ error_at (loc, "lvalue required as increment operand");
break;
case lv_decrement:
- error ("lvalue required as decrement operand");
+ error_at (loc, "lvalue required as decrement operand");
break;
case lv_addressof:
- error ("lvalue required as unary %<&%> operand");
+ error_at (loc, "lvalue required as unary %<&%> operand");
break;
case lv_asm:
- error ("lvalue required in asm statement");
+ error_at (loc, "lvalue required in asm statement");
break;
default:
gcc_unreachable ();
diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h
index 12845757c09..05456d33abd 100644
--- a/gcc/c-family/c-common.h
+++ b/gcc/c-family/c-common.h
@@ -1,6 +1,6 @@
/* Definitions for c-common.c.
Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GCC.
@@ -929,7 +929,7 @@ enum lvalue_use {
};
extern void readonly_error (tree, enum lvalue_use);
-extern void lvalue_error (enum lvalue_use);
+extern void lvalue_error (location_t, enum lvalue_use);
extern void invalid_indirection_error (location_t, tree, ref_operator);
extern int complete_array_type (tree *, tree, bool);