aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-01-31 08:37:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-01-31 08:37:34 +0100
commit8936f047c08193cdb5f5dda9d630e1b35045fe5e (patch)
treedc4a47963adbd9eb8ecd813c6167bfdf592140bb /gcc
parent474175e925a90166e1f4adcc83f9ddfbab1f841b (diff)
downloadgcc-8936f047c08193cdb5f5dda9d630e1b35045fe5e.zip
gcc-8936f047c08193cdb5f5dda9d630e1b35045fe5e.tar.gz
gcc-8936f047c08193cdb5f5dda9d630e1b35045fe5e.tar.bz2
re PR libstdc++/88170 (pretty printer FAILs)
PR libstdc++/88170 * c-pretty-print.c (pp_c_enumeration_constant): Print always as a C cast in pp_c_flag_gnu_v3 mode. * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as a C cast in pp_c_flag_gnu_v3 mode. From-SVN: r268413
Diffstat (limited to 'gcc')
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-pretty-print.c12
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/cxx-pretty-print.c12
4 files changed, 24 insertions, 12 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 3c55209..25c5323 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/88170
+ * c-pretty-print.c (pp_c_enumeration_constant): Print always as
+ a C cast in pp_c_flag_gnu_v3 mode.
+
2019-01-29 Jakub Jelinek <jakub@redhat.com>
PR c/86125
diff --git a/gcc/c-family/c-pretty-print.c b/gcc/c-family/c-pretty-print.c
index 46db469..3e25624 100644
--- a/gcc/c-family/c-pretty-print.c
+++ b/gcc/c-family/c-pretty-print.c
@@ -976,14 +976,14 @@ static void
pp_c_enumeration_constant (c_pretty_printer *pp, tree e)
{
tree type = TREE_TYPE (e);
- tree value;
+ tree value = NULL_TREE;
/* Find the name of this constant. */
- for (value = TYPE_VALUES (type);
- value != NULL_TREE
- && !tree_int_cst_equal (DECL_INITIAL (TREE_VALUE (value)), e);
- value = TREE_CHAIN (value))
- ;
+ if ((pp->flags & pp_c_flag_gnu_v3) == 0)
+ for (value = TYPE_VALUES (type); value != NULL_TREE;
+ value = TREE_CHAIN (value))
+ if (tree_int_cst_equal (DECL_INITIAL (TREE_VALUE (value)), e))
+ break;
if (value != NULL_TREE)
pp->id_expression (TREE_PURPOSE (value));
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 29d8742..884f09c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2019-01-31 Jakub Jelinek <jakub@redhat.com>
+
+ PR libstdc++/88170
+ * cxx-pretty-print.c (pp_cxx_enumeration_constant): Print always as
+ a C cast in pp_c_flag_gnu_v3 mode.
+
2019-01-30 Jakub Jelinek <jakub@redhat.com>
PR c++/88988
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index a114d66..a0088a2 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -309,14 +309,14 @@ static void
pp_cxx_enumeration_constant (cxx_pretty_printer *pp, tree e)
{
tree type = TREE_TYPE (e);
- tree value;
+ tree value = NULL_TREE;
/* Find the name of this constant. */
- for (value = TYPE_VALUES (type);
- value != NULL_TREE
- && !tree_int_cst_equal (DECL_INITIAL (TREE_VALUE (value)), e);
- value = TREE_CHAIN (value))
- ;
+ if ((pp->flags & pp_c_flag_gnu_v3) == 0)
+ for (value = TYPE_VALUES (type); value != NULL_TREE;
+ value = TREE_CHAIN (value))
+ if (tree_int_cst_equal (DECL_INITIAL (TREE_VALUE (value)), e))
+ break;
if (value != NULL_TREE)
{