diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-07-27 17:46:25 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-07-27 17:46:25 +0200 |
commit | f551f80cd19ae94af5ed73c2ccb05a18731acc85 (patch) | |
tree | 156a4855615d55e744814ea708779ee3f041f7fe /gcc | |
parent | a78e242c07978510dd484adcba87f90dd4f0555e (diff) | |
download | gcc-f551f80cd19ae94af5ed73c2ccb05a18731acc85.zip gcc-f551f80cd19ae94af5ed73c2ccb05a18731acc85.tar.gz gcc-f551f80cd19ae94af5ed73c2ccb05a18731acc85.tar.bz2 |
re PR c/45079 (function names in error message (�c_maybe_const_expr� not supported by 'pp_c_expression'))
PR c/45079
* c-pretty-print.c (pp_c_expression): Handle C_MAYBE_CONST_EXPR.
* gcc.dg/pr45079.c: New test.
From-SVN: r162575
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-pretty-print.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr45079.c | 10 |
4 files changed, 24 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 17bd6ab..d5f3e6e 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -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. diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c index 7f4b238..d72ff30 100644 --- a/gcc/c-family/c-pretty-print.c +++ b/gcc/c-family/c-pretty-print.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ee1d1f6..6a33122 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..1ef02ff --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr45079.c @@ -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 } */ |