This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Handle VIEW_CONVERT_EXPR in C diagnostics (PR c/35442)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]