PR c++/70167 - array prvalue treated as lvalue
authorJason Merrill <jason@redhat.com>
Tue, 9 May 2017 13:48:58 +0000 (09:48 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 9 May 2017 13:48:58 +0000 (09:48 -0400)
commit6064858051d6e07bb89f3384c0d828f07c576c7a
tree815f68ce3b1ebd2059c5d426b0319427a127795a
parent6c38fbc648dc7bfa73ef703d1584196f64dcc151
PR c++/70167 - array prvalue treated as lvalue

* cp-tree.h (CONSTRUCTOR_C99_COMPOUND_LITERAL): New.
(enum fcl_t): New.
* semantics.c (finish_compound_literal): Add fcl_context parameter.
Only make a static variable for C99 syntax.
* parser.c (cp_parser_postfix_expression): Pass it.
* pt.c (tsubst_copy_and_build): Likewise.
* call.c (extend_ref_init_temps): Set
DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P.

From-SVN: r247793
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/testsuite/g++.dg/cpp0x/initlist-array6.C [new file with mode: 0644]