]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/35442 (Completely broken diagnostic with view_convert_expr)
authorJakub Jelinek <jakub@redhat.com>
Mon, 8 Dec 2008 18:03:40 +0000 (19:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 8 Dec 2008 18:03:40 +0000 (19:03 +0100)
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.

From-SVN: r142558

gcc/ChangeLog
gcc/c-pretty-print.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr35442.c [new file with mode: 0644]

index 248979115b0fc0dae6e8674669d4d80ecdf4e47b..4a35cf450f44eb2a4bdc865429bf5a2e84cc9ae4 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2008-12-08  Richard Henderson  <rth@redhat.com>
 
        PR 38240
index cf1c6c3f52c2f0035e048612069db76236011a3f..cc366791cfdc2d77ee0d2c53634db8cde8e016bc 100644 (file)
@@ -1629,6 +1629,7 @@ pp_c_cast_expression (c_pretty_printer *pp, tree e)
     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, tree e)
     case FLOAT_EXPR:
     case FIX_TRUNC_EXPR:
     CASE_CONVERT:
+    case VIEW_CONVERT_EXPR:
       pp_c_cast_expression (pp, e);
       break;
 
index 696d82a1a53257f0ccf027a838d1f483bae0b8ac..84fd6210dbff49364110740380d2545675821ea7 100644 (file)
@@ -1,3 +1,8 @@
+2008-12-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/35442
+       * gcc.dg/pr35442.c: New test.
+
 2008-12-07  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/string_comparison.adb: New test.
diff --git a/gcc/testsuite/gcc.dg/pr35442.c b/gcc/testsuite/gcc.dg/pr35442.c
new file mode 100644 (file)
index 0000000..4f1e3cc
--- /dev/null
@@ -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" } */
+}