/usr/src/gcc-4.8/debian/patches/pr61046.diff is in gcc-4.8-source 4.8.5-4ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | # 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.
Index: b/src/gcc/testsuite/g++.dg/ext/desig7.C
===================================================================
--- /dev/null
+++ b/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" }
Index: b/src/gcc/cp/decl.c
===================================================================
--- a/src/gcc/cp/decl.c
+++ b/src/gcc/cp/decl.c
@@ -5203,7 +5203,12 @@ reshape_init_class (tree type, reshape_i
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"
@@ -5211,12 +5216,6 @@ reshape_init_class (tree type, reshape_i
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)
|