This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70167] Some const array prvalues are incorrectly treated as lvalues
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 May 2017 13:49:31 +0000
- Subject: [Bug c++/70167] Some const array prvalues are incorrectly treated as lvalues
- Auto-submitted: auto-generated
- References: <bug-70167-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70167
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue May 9 13:48:58 2017
New Revision: 247793
URL: https://gcc.gnu.org/viewcvs?rev=247793&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/initlist-array6.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/semantics.c