This is the mail archive of the gcc-cvs@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]

r242377 - in /trunk/gcc: ChangeLog cp/ChangeLog...


Author: jason
Date: Mon Nov 14 05:02:58 2016
New Revision: 242377

URL: https://gcc.gnu.org/viewcvs?rev=242377&root=gcc&view=rev
Log:
	Implement P0217R3 - C++17 structured bindings

gcc/
	* match.pd: Don't try to compare addresses of variables with
	DECL_VALUE_EXPR.
gcc/cp/
	* cp-tree.h (struct lang_decl_base): Add decomposition_p.
	(DECL_DECOMPOSITION_P): New
	(enum auto_deduction_context): Add adc_decomp_type.
	(enum cp_declarator_kind): Add cdk_decomp.
	* constexpr.c (cxx_eval_constant_expression): Look through
	DECL_VALUE_EXPR.
	(potential_constant_expression_1): Likewise.
	* decl.c (reshape_init): Preserve CONSTRUCTOR_IS_DIRECT_INIT.
	(check_initializer): Use build_aggr_init for DECL_DECOMPOSITION_P.
	(cp_finish_decl): Pass adc_decomp_type for decomposition.
	(find_decomp_class_base, get_tuple_size, get_tuple_element_type)
	(get_tuple_decomp_init, cp_finish_decomp): New.
	(grokdeclarator): Handle decomposition.
	* init.c (build_aggr_init): Handle decomposition array.
	(build_vec_init): Handle initialization from { array }.
	* name-lookup.c (add_function): Always wrap TEMPLATE_DECL in
	OVERLOAD.
	* parser.c (declarator_can_be_parameter_pack): Handle cdk_decomp.
	(function_declarator_p, strip_declarator_types)
	(cp_parser_check_declarator_template_parameters): Likewise.
	(cp_parser_range_for, cp_convert_range_for): Handle decomposition.
	(cp_parser_simple_declaration): Parse decomposition.
	(cp_parser_decomposition_declaration): New.
	* pt.c (tsubst_decomp_names): New.
	(subst_expr) [DECL_EXPR, RANGE_FOR_STMT]: Handle decomposition.
	(do_auto_deduction): Handle adc_decomp_type.
	* semantics.c (finish_decltype_type): Look through DECL_VALUE_EXPR.
	* typeck.c (is_bitfield_expr_with_lowered_type): Likewise.
	* tree.c (lvalue_kind): Likewise.
	(cp_build_reference_type): Handle reference collapsing.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/init.c
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/cp/tree.c
    trunk/gcc/cp/typeck.c
    trunk/gcc/match.pd
    trunk/gcc/testsuite/g++.dg/parse/parser-pr14875-2.C


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