aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2012-04-21 14:53:21 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2012-04-21 14:53:21 +0000
commitae52741c5e69eafabc749445ca991b01857f4ea0 (patch)
treee0172180b9b6ef470102a85cd1da2ee85e3ccdb1 /gcc/cp
parentaab316c7c997b98b4aa4413856c5c743a4bf6f1d (diff)
downloadgcc-ae52741c5e69eafabc749445ca991b01857f4ea0.zip
gcc-ae52741c5e69eafabc749445ca991b01857f4ea0.tar.gz
gcc-ae52741c5e69eafabc749445ca991b01857f4ea0.tar.bz2
re PR c/35441 (pretty-printer cannot handle some expressions)
2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 35441 * c-typeck.c (inform_declaration): New. (build_function_call_vec): Do not pretty-print expressions when caret is enabled. (convert_arguments): Use inform_declaration. cp/ * typeck.c (cp_build_function_call_vec): Do not pretty-print expressions when caret is enabled. testsuite/ * c-c++-common/pr35441.C: New. From-SVN: r186652
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/typeck.c13
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e9af16c..479ff69 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2012-04-21 Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+ PR 35441
+ * typeck.c (cp_build_function_call_vec): Do not pretty-print
+ expressions when caret is enabled.
+
2012-04-20 Jan Hubicka <jh@suse.cz>
PR target/53042
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 01fea6f..5fb0946 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -3322,7 +3322,18 @@ cp_build_function_call_vec (tree function, VEC(tree,gc) **params,
|| TREE_CODE (function) == TEMPLATE_ID_EXPR))
{
if (complain & tf_error)
- error ("%qE cannot be used as a function", original);
+ {
+ if (!flag_diagnostics_show_caret)
+ error_at (input_location,
+ "%qE cannot be used as a function", original);
+ else if (DECL_P (original))
+ error_at (input_location,
+ "%qD cannot be used as a function", original);
+ else
+ error_at (input_location,
+ "expression cannot be used as a function");
+ }
+
return error_mark_node;
}