Commit f0c721ad by Daniel Berlin Committed by Daniel Berlin

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
parent 5775a06a
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
......
......@@ -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:
......
......@@ -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;
}
......
/* { 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" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment