aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-06-01 18:48:58 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-06-01 18:48:58 -0400
commitbdc2c1ea35c16d3bbd3711430d8035dd54cfcf20 (patch)
tree8c2d001446b0f3e6569ce4e0e4c130f6c37ee195 /gcc/cp
parent884d4d1167b0014eb0cf21fda21cd5759a9a5bbb (diff)
downloadgcc-bdc2c1ea35c16d3bbd3711430d8035dd54cfcf20.zip
gcc-bdc2c1ea35c16d3bbd3711430d8035dd54cfcf20.tar.gz
gcc-bdc2c1ea35c16d3bbd3711430d8035dd54cfcf20.tar.bz2
PR c++/85873 - constant initializer_list array not in .rodata.
* call.c (convert_like_real): Treat the backing array for an initializer_list like a C99 compound literal. From-SVN: r261091
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ba85433..4a7afbf 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/85873 - constant initializer_list array not in .rodata.
+ * call.c (convert_like_real): Treat the backing array for an
+ initializer_list like a C99 compound literal.
+
2018-05-30 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index f5d9b6c..10b8858 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6872,7 +6872,7 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
elttype = cp_build_qualified_type
(elttype, cp_type_quals (elttype) | TYPE_QUAL_CONST);
array = build_array_of_n_type (elttype, len);
- array = finish_compound_literal (array, new_ctor, complain);
+ array = finish_compound_literal (array, new_ctor, complain, fcl_c99);
/* Take the address explicitly rather than via decay_conversion
to avoid the error about taking the address of a temporary. */
array = cp_build_addr_expr (array, complain);