aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-05-10 14:35:25 +0000
committerJason Merrill <jason@redhat.com>2013-05-10 14:35:25 +0000
commit88469d7f18d92c9c50f44386052c94e215acb7af (patch)
tree52512121785c8ed21c95f39b773819faaf14f392 /gcc/cp
parent17327e121b3b05646f1ba8d9e1b06019a734d1bd (diff)
PR c++/57047
* semantics.c (cxx_fold_indirect_ref): Fix thinko. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@198780 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/semantics.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a18a8691b7b..8713855671c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-10 Jason Merrill <jason@redhat.com>
+
+ PR c++/57047
+ * semantics.c (cxx_fold_indirect_ref): Fix thinko.
+
2013-05-09 Jason Merrill <jason@redhat.com>
PR c++/57222
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index bc3fddedca6..1953c598538 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -7588,15 +7588,17 @@ cxx_fold_indirect_ref (location_t loc, tree type, tree op0, bool *empty_base)
}
}
}
- /* *(foo *)fooarrptreturn> (*fooarrptr)[0] */
+ /* *(foo *)fooarrptr => (*fooarrptr)[0] */
else if (TREE_CODE (TREE_TYPE (subtype)) == ARRAY_TYPE
&& (same_type_ignoring_top_level_qualifiers_p
(type, TREE_TYPE (TREE_TYPE (subtype)))))
{
tree type_domain;
tree min_val = size_zero_node;
- sub = cxx_fold_indirect_ref (loc, TREE_TYPE (subtype), sub, NULL);
- if (!sub)
+ tree newsub = cxx_fold_indirect_ref (loc, TREE_TYPE (subtype), sub, NULL);
+ if (newsub)
+ sub = newsub;
+ else
sub = build1_loc (loc, INDIRECT_REF, TREE_TYPE (subtype), sub);
type_domain = TYPE_DOMAIN (TREE_TYPE (sub));
if (type_domain && TYPE_MIN_VALUE (type_domain))