summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-06-03 13:02:15 +0000
committerdoko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca>2014-06-03 13:02:15 +0000
commit766be60b92430e6ed316569452b7910422a6c470 (patch)
tree2829f8291222f2055209a5b6fc1444a60481ff1a
parent925c7b5fe8a511bdf462913396f86c3aba350750 (diff)
downloadgcc-48-766be60b92430e6ed316569452b7910422a6c470.tar.gz
* Fix PR c++/61046, taken from the trunk. LP: #1313102.
git-svn-id: svn://svn.debian.org/svn/gcccvs/branches/sid/gcc-4.8@7433 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/pr61046.diff50
-rw-r--r--debian/rules.patch1
3 files changed, 52 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index c3408e9..676b838 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ gcc-4.8 (4.8.3-3) UNRELEASED; urgency=medium
but into the gdb auto-load directory.
* Fix the removal of the libstdc++6 package, removing byte-compiled pretty
printer files and pycache directories.
+ * Fix PR c++/61046, taken from the trunk. LP: #1313102.
-- Matthias Klose <doko@debian.org> Mon, 02 Jun 2014 18:20:23 +0200
diff --git a/debian/patches/pr61046.diff b/debian/patches/pr61046.diff
new file mode 100644
index 0000000..f303f43
--- /dev/null
+++ b/debian/patches/pr61046.diff
@@ -0,0 +1,50 @@
+# DP: Fix PR c++/61046, taken from the trunk.
+
+gcc/cp/
+
+2014-06-02 Jason Merrill <jason@redhat.com>
+
+ PR c++/61046
+ * decl.c (reshape_init_class): Handle un-folded
+ constant-expressions.
+
+--- a/src/gcc/testsuite/g++.dg/ext/desig7.C
++++ a/src/gcc/testsuite/g++.dg/ext/desig7.C
+@@ -0,0 +1,8 @@
++// PR c++/61046
++
++struct A
++{
++ int ary[4];
++};
++const int i = 0;
++A bar = { [i] = 0 }; // { dg-error "designated" }
+--- a/src/gcc/cp/decl.c
++++ a/src/gcc/cp/decl.c
+@@ -5294,7 +5294,12 @@
+ if (d->cur->index == error_mark_node)
+ return error_mark_node;
+
+- if (TREE_CODE (d->cur->index) == INTEGER_CST)
++ if (TREE_CODE (d->cur->index) == FIELD_DECL)
++ /* We already reshaped this. */
++ gcc_assert (d->cur->index == field);
++ else if (TREE_CODE (d->cur->index) == IDENTIFIER_NODE)
++ field = lookup_field_1 (type, d->cur->index, /*want_type=*/false);
++ else
+ {
+ if (complain & tf_error)
+ error ("%<[%E] =%> used in a GNU-style designated initializer"
+@@ -5302,12 +5307,6 @@
+ return error_mark_node;
+ }
+
+- if (TREE_CODE (d->cur->index) == FIELD_DECL)
+- /* We already reshaped this. */
+- gcc_assert (d->cur->index == field);
+- else
+- field = lookup_field_1 (type, d->cur->index, /*want_type=*/false);
+-
+ if (!field || TREE_CODE (field) != FIELD_DECL)
+ {
+ if (complain & tf_error)
diff --git a/debian/rules.patch b/debian/rules.patch
index 1ea7543..7237c2b 100644
--- a/debian/rules.patch
+++ b/debian/rules.patch
@@ -96,6 +96,7 @@ debian_patches += \
pr61126 \
pr57653 \
libitm-aarch64 \
+ pr61046 \
# FIXME: still necessary for cross building the native compiler?
# gcc-auto-build \