]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c/45079 (function names in error message (�c_maybe_const_expr� not supported...
authorJakub Jelinek <jakub@redhat.com>
Tue, 27 Jul 2010 15:46:25 +0000 (17:46 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 27 Jul 2010 15:46:25 +0000 (17:46 +0200)
PR c/45079
* c-pretty-print.c (pp_c_expression): Handle C_MAYBE_CONST_EXPR.

* gcc.dg/pr45079.c: New test.

From-SVN: r162575

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

index 17bd6ab56f5f83e42b5bb18f03ca34af21c991eb..d5f3e6eabb3e78fa034d47f05b1bcc05ed3ea479 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/45079
+       * c-pretty-print.c (pp_c_expression): Handle C_MAYBE_CONST_EXPR.
+
 2010-07-27  Joseph Myers  <joseph@codesourcery.com>
 
        * c-common.h (c_common_missing_argument): Remove.
index 7f4b2388f43e1fb53cbccadcf1cbfae7202b4cf4..d72ff309753f5ad99c1a2b1da94b9e42017a2291 100644 (file)
@@ -2167,6 +2167,10 @@ pp_c_expression (c_pretty_printer *pp, tree e)
       pp_string (pp, "({...})");
       break;
 
+    case C_MAYBE_CONST_EXPR:
+      pp_c_expression (pp, C_MAYBE_CONST_EXPR_EXPR (e));
+      break;
+
     default:
       pp_unsupported_tree (pp, e);
       break;
index ee1d1f63740f3fd35dd93fc4111b2d5d8bfe518b..6a331227cd248c9ff2956ef83f714d718fdc7dcd 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-27  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c/45079
+       * gcc.dg/pr45079.c: New test.
+
 2010-07-27  Ira Rosen  <irar@il.ibm.com>
 
        PR tree-optimization/44152
diff --git a/gcc/testsuite/gcc.dg/pr45079.c b/gcc/testsuite/gcc.dg/pr45079.c
new file mode 100644 (file)
index 0000000..1ef02ff
--- /dev/null
@@ -0,0 +1,10 @@
+/* PR c/45079 */
+/* { dg-do compile } */
+
+void
+foo (const char *p, int cond, int a, int b)
+{
+  p[cond ? a : b] = '\0';      /* { dg-error "assignment of read-only location" } */
+}
+
+/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */