This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70167] Some const array prvalues are incorrectly treated as lvalues


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]