aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2004-09-21 15:42:44 +0000
committerDaniel Berlin <dberlin@gcc.gnu.org>2004-09-21 15:42:44 +0000
commitf0c721ad7cc43cb007beb8a55cb088f17a2a065b (patch)
tree2204defb2a1b87a08691c53ec1e9648bcdadb633
parent5775a06aa64761ba8521ad79bd1a2cc8429a6750 (diff)
downloadgcc-f0c721ad7cc43cb007beb8a55cb088f17a2a065b.zip
gcc-f0c721ad7cc43cb007beb8a55cb088f17a2a065b.tar.gz
gcc-f0c721ad7cc43cb007beb8a55cb088f17a2a065b.tar.bz2
c-typeck.c (build_function_call): Give name of object we are attempting to call in error message.
2004-09-21 Daniel Berlin <dberlin@dberlin.org> * c-typeck.c (build_function_call): Give name of object we are attempting to call in error message. * c-objc-common.c (c_tree_printer): Call pp_expression, not return false, for 'E' case. From-SVN: r87809
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-objc-common.c2
-rw-r--r--gcc/c-typeck.c2
-rw-r--r--gcc/testsuite/gcc.dg/20040920-1.c12
4 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 801759d..7d034c4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2004-09-21 Daniel Berlin <dberlin@dberlin.org>
+
+ * c-typeck.c (build_function_call): Give name of object
+ we are attempting to call in error message.
+ * c-objc-common.c (c_tree_printer): Call pp_expression,
+ not return false, for 'E' case.
+
2004-09-21 Steven Bosscher <stevenb@suse.de>
PR rtl-optimization/17482
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index d59aed1..0259fe5 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -235,7 +235,7 @@ c_tree_printer (pretty_printer *pp, text_info *text)
if (TREE_CODE (t) == IDENTIFIER_NODE)
n = IDENTIFIER_POINTER (t);
else
- return false;
+ pp_expression (cpp, t);
break;
default:
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index a7f7763..d94965b 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1926,7 +1926,7 @@ build_function_call (tree function, tree params)
if (!(TREE_CODE (fntype) == POINTER_TYPE
&& TREE_CODE (TREE_TYPE (fntype)) == FUNCTION_TYPE))
{
- error ("called object is not a function");
+ error ("called object %qE is not a function", function);
return error_mark_node;
}
diff --git a/gcc/testsuite/gcc.dg/20040920-1.c b/gcc/testsuite/gcc.dg/20040920-1.c
new file mode 100644
index 0000000..8813963
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20040920-1.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+int bob;
+struct a
+{
+ int foo;
+};
+int main(void)
+{
+ struct a bar;
+ bob(5); /* { dg-error "called object 'bob\\({anonymous}\\)' is not a function" } */
+ bar.foo(); /* { dg-error "called object 'bar.foo\\({anonymous}\\)' is not a function" } */
+}