This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Handle VIEW_CONVERT_EXPR in C diagnostics (PR c/35442)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Gabriel Dos Reis <gdr at cs dot tamu dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 8 Dec 2008 17:10:09 +0100
- Subject: [PATCH] Handle VIEW_CONVERT_EXPR in C diagnostics (PR c/35442)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
This patch handles VCE in C pretty-printer similarly to how it is handled
in C++ error.c.
Bootstrapped/regtested on x86_64-linux, ok for trunk?
2008-12-08 Jakub Jelinek <jakub@redhat.com>
PR c/35442
* c-pretty-print.c (pp_c_cast_expression, pp_c_expression): Handle
VIEW_CONVERT_EXPR the same as CASE_CONVERT.
* gcc.dg/pr35442.c: New test.
--- gcc/c-pretty-print.c.jj 2008-12-05 22:09:52.000000000 +0100
+++ gcc/c-pretty-print.c 2008-12-08 14:18:50.000000000 +0100
@@ -1629,6 +1629,7 @@ pp_c_cast_expression (c_pretty_printer *
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
pp_c_type_cast (pp, TREE_TYPE (e));
pp_c_cast_expression (pp, TREE_OPERAND (e, 0));
break;
@@ -2020,6 +2021,7 @@ pp_c_expression (c_pretty_printer *pp, t
case FLOAT_EXPR:
case FIX_TRUNC_EXPR:
CASE_CONVERT:
+ case VIEW_CONVERT_EXPR:
pp_c_cast_expression (pp, e);
break;
--- gcc/testsuite/gcc.dg/pr35442.c.jj 2008-12-08 14:23:49.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr35442.c 2008-12-08 14:23:21.000000000 +0100
@@ -0,0 +1,11 @@
+/* PR c/35442 */
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */
+
+typedef char A __attribute__ ((vector_size (64)));
+typedef int B __attribute__ ((vector_size (64)));
+
+void
+foo (A a)
+{
+ ((B) a) (); /* { dg-error "is not a function" } */
+}
Jakub