From 82665822b174f025389699abd0a124d44d80a200 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 11 Apr 2017 10:51:40 +0200 Subject: [PATCH] re PR c++/80363 (#'vec_cond_expr' not supported by dump_expr#) PR c++/80363 * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR. * g++.dg/ext/pr80363.C: New test. From-SVN: r246834 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/error.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/ext/pr80363.C | 12 ++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/ext/pr80363.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b7cbca58e95..e16efdccb8e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2017-04-11 Jakub Jelinek + + PR c++/80363 + * error.c (dump_expr): Handle VEC_COND_EXPR like COND_EXPR. + 2017-04-10 Jakub Jelinek PR c++/80176 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d8c5d5ea412..f93e8b67841 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -2080,6 +2080,7 @@ dump_expr (cxx_pretty_printer *pp, tree t, int flags) break; case COND_EXPR: + case VEC_COND_EXPR: pp_cxx_left_paren (pp); dump_expr (pp, TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS); pp_string (pp, " ? "); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a2d08655028..d0f5620d844 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-11 Jakub Jelinek + + PR c++/80363 + * g++.dg/ext/pr80363.C: New test. + 2017-04-11 Senthil Kumar Selvaraj * gcc.dg/tree-ssa/builtin-sprintf-warn-10.c: Require double64plus. diff --git a/gcc/testsuite/g++.dg/ext/pr80363.C b/gcc/testsuite/g++.dg/ext/pr80363.C new file mode 100644 index 00000000000..2ff7bca80b6 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/pr80363.C @@ -0,0 +1,12 @@ +// PR c++/80363 +// { dg-do compile } + +typedef int V __attribute__((vector_size (16))); + +int +foo (V *a, V *b) +{ + if (*a < *b) // { dg-error "could not convert\[^#]*from" } + return 1; + return 0; +} -- 2.30.2