From 8e745a17093aa4b5965fcf327c9d76f27e6c852f Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 14 Nov 2016 20:00:32 +0100 Subject: [PATCH] c-cppbuiltin.c (c_cpp_builtins): Define __cpp_structured_bindings. * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_structured_bindings. * g++.dg/cpp1z/feat-cxx1z.C: Test __cpp_structured_bindings macro. From-SVN: r242395 --- gcc/ChangeLog | 38 ++++++------- gcc/c-family/ChangeLog | 52 +++++++++-------- gcc/c-family/c-cppbuiltin.c | 1 + gcc/c/ChangeLog | 74 ++++++++++++------------- gcc/cp/ChangeLog | 4 +- gcc/testsuite/ChangeLog | 44 ++++++++------- gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C | 6 ++ 7 files changed, 117 insertions(+), 102 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f259470e9fa..fd132b5acef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,6 @@ 2016-11-14 Thomas Preud'homme - * tree-ssa-math-opts.c (find_bswap_or_nop): Zero out bytes in cmpxchg + * tree-ssa-math-opts.c (find_bswap_or_nop): Zero out bytes in cmpxchg and cmpnop in two steps: first the ones not accessed in original gimple expression in a endian independent way and then the ones not accessed in the final result in an endian-specific way. @@ -17,12 +17,12 @@ new line. 2016-11-14 Prasad Ghangal - Richard Biener + Richard Biener * doc/invoke.texi (fgimple): Document. - * dumpfile.h (TDF_GIMPLE): Add. - * dumpfile.c (dump_options): Add gimple. - * gimple-pretty-print.c (dump_gimple_switch): Adjust dump + * dumpfile.h (TDF_GIMPLE): Add. + * dumpfile.c (dump_options): Add gimple. + * gimple-pretty-print.c (dump_gimple_switch): Adjust dump for TDF_GIMPLE. (dump_gimple_label): Likewise. (dump_gimple_phi): Likewise. @@ -30,25 +30,25 @@ (dump_phi_nodes): Likewise. (pp_cfg_jump): Likewise. Pass in dump flags. (dump_implicit_edges): Adjust. - * passes.c (pass_init_dump_file): Do not dump function header - for TDF_GIMPLE. - * tree-cfg.c (dump_function_to_file): Dump function return type + * passes.c (pass_init_dump_file): Do not dump function header + for TDF_GIMPLE. + * tree-cfg.c (dump_function_to_file): Dump function return type and __GIMPLE keyword for TDF_GIMPLE. Change guard for dumping GIMPLE stmts. - * tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE. - (dump_generic_node): Likewise. + * tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE. + (dump_generic_node): Likewise. * function.h (struct function): Add pass_startwith member. * passes.c (execute_one_pass): Implement startwith. - * tree-ssanames.c (make_ssa_name_fn): New argument, check for version - and assign proper version for parsed ssa names. - * tree-ssanames.h (make_ssa_name_fn): Add new argument to the function. - * internal-fn.c (expand_PHI): New function. - * internal-fn.h (expand_PHI): Declared here. - * internal-fn.def: New defination for PHI. - * tree-cfg.c (lower_phi_internal_fn): New function. + * tree-ssanames.c (make_ssa_name_fn): New argument, check for version + and assign proper version for parsed ssa names. + * tree-ssanames.h (make_ssa_name_fn): Add new argument to the function. + * internal-fn.c (expand_PHI): New function. + * internal-fn.h (expand_PHI): Declared here. + * internal-fn.def: New defination for PHI. + * tree-cfg.c (lower_phi_internal_fn): New function. (build_gimple_cfg): Call it. - (verify_gimple_call): Condition for passing label as arg in internal - function PHI. + (verify_gimple_call): Condition for passing label as arg in internal + function PHI. * tree-into-ssa.c (rewrite_add_phi_arguments): Handle already present PHIs with arguments. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 2360d9ed17c..cb1b35c86e5 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,9 +1,13 @@ +2016-11-14 Jakub Jelinek + + * c-cppbuiltin.c (c_cpp_builtins): Define __cpp_structured_bindings. + 2016-11-14 Prasad Ghangal - Richard Biener - - * c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types. - * c-common.h (enum rid): Add RID_GIMPLE, RID_PHI. - * c.opt (fgimple): New option. + Richard Biener + + * c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types. + * c-common.h (enum rid): Add RID_GIMPLE, RID_PHI. + * c.opt (fgimple): New option. 2016-11-13 Eric Botcazou @@ -590,7 +594,7 @@ Use a copy when emitting warnings, setting the caret index from TYPE. 2016-08-16 Eric Botcazou - Arnaud Charlet + Arnaud Charlet * c-ada-spec.c (dump_number): New function. (handle_escape_character): Likewise. @@ -2511,7 +2515,7 @@ before trying to figure out whether we have a flexible array member. 2015-03-06 Eric Botcazou - Jonathan Wakely + Jonathan Wakely * c-ada-spec.c (dump_ada_double_name): Fix pasto. @@ -4033,15 +4037,15 @@ that lower floating point number precision or about the other kinds of conversions. * c-common.h (enum conversion_safety): New enumeration. - (unsafe_conversion_p): switching return type to - conversion_safety enumeration. + (unsafe_conversion_p): switching return type to + conversion_safety enumeration. * c.opt: Adding new warning -Wfloat-conversion and enabling it with -Wconversion. 2013-11-19 Basile Starynkevitch - * c-opts.c: Include plugin.h. - (cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE. + * c-opts.c: Include plugin.h. + (cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE. 2013-11-19 Marek Polacek @@ -4261,7 +4265,7 @@ 2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> - Implement C++14 digit separators. + Implement C++14 digit separators. * c-lex.c (interpret_float): Remove digit separators from scratch string before building real literal. @@ -4829,7 +4833,7 @@ __GXX_EXPERIMENTAL_CXX1Y__. 2013-04-24 Paolo Carlini - Manuel Lopez-Ibanez + Manuel Lopez-Ibanez * c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented. * c-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns @@ -4970,7 +4974,7 @@ PR 55139 * c-common.c (get_atomic_generic_size): Mask with - MEMMODEL_MASK + MEMMODEL_MASK 2012-11-07 Manuel López-Ibáñez @@ -4984,16 +4988,16 @@ * c-opts.c (c_common_handle_option): Do not handle Wformat here. * c-format.c (set_Wformat): Delete. (decode_format_attr): Replace OPT_Wformat with OPT_Wformat_. - (maybe_read_dollar_number): Likewise. - (avoid_dollar_number): Likewise. - (finish_dollar_format_checking): Likewise. - (check_format_info): Likewise. - (check_format_info_main): Likewise. - (check_format_types): Likewise. - (format_type_warning): Likewise. - * c-common.c (int): Likewise. - (check_function_sentinel): Likewise. - * c-common.h (warn_format,set_Wformat): Do not declare here. + (maybe_read_dollar_number): Likewise. + (avoid_dollar_number): Likewise. + (finish_dollar_format_checking): Likewise. + (check_format_info): Likewise. + (check_format_info_main): Likewise. + (check_format_types): Likewise. + (format_type_warning): Likewise. + * c-common.c (int): Likewise. + (check_function_sentinel): Likewise. + * c-common.h (warn_format,set_Wformat): Do not declare here. 2012-11-07 Manuel López-Ibáñez diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c index 70eade170e6..5c88e91e9e3 100644 --- a/gcc/c-family/c-cppbuiltin.c +++ b/gcc/c-family/c-cppbuiltin.c @@ -943,6 +943,7 @@ c_cpp_builtins (cpp_reader *pfile) cpp_define (pfile, "__cpp_deduction_guides=201606"); cpp_define (pfile, "__cpp_noexcept_function_type=201510"); cpp_define (pfile, "__cpp_template_auto=201606"); + cpp_define (pfile, "__cpp_structured_bindings=201606"); } if (flag_concepts) cpp_define (pfile, "__cpp_concepts=201507"); diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 75f39d7ed8b..1cb30e719bf 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,41 +1,41 @@ 2016-11-14 Prasad Ghangal - Richard Biener + Richard Biener - * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. - * config-lang.in (gtfiles): Add c/c-parser.h. - * c-tree.h (enum c_declspec_word): Add cdw_gimple. - (struct c_declspecs): Add gimple_pass member and gimple_p flag. - * c-parser.c (enum c_id_kind, struct c_token, - c_parser_next_token_is, c_parser_next_token_is_not, - c_parser_next_token_is_keyword, - enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec): - Split out to ... - * c-parser.h: ... new header. - * c-parser.c: Include c-parser.h and gimple-parser.h. + * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. + * config-lang.in (gtfiles): Add c/c-parser.h. + * c-tree.h (enum c_declspec_word): Add cdw_gimple. + (struct c_declspecs): Add gimple_pass member and gimple_p flag. + * c-parser.c (enum c_id_kind, struct c_token, + c_parser_next_token_is, c_parser_next_token_is_not, + c_parser_next_token_is_keyword, + enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec): + Split out to ... + * c-parser.h: ... new header. + * c-parser.c: Include c-parser.h and gimple-parser.h. (c_parser_peek_token, c_parser_peek_2nd_token, - c_token_starts_typename, c_parser_next_token_starts_declspecs, - c_parser_next_tokens_start_declaration, c_parser_consume_token, - c_parser_error, c_parser_require, c_parser_skip_until_found, - c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, - c_parser_type_name): Export. - (c_parser_tokens_buf): New function. - (c_parser_error): Likewise. - (c_parser_set_error): Likewise. - (c_parser_declspecs): Handle RID_GIMPLE. + c_token_starts_typename, c_parser_next_token_starts_declspecs, + c_parser_next_tokens_start_declaration, c_parser_consume_token, + c_parser_error, c_parser_require, c_parser_skip_until_found, + c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, + c_parser_type_name): Export. + (c_parser_tokens_buf): New function. + (c_parser_error): Likewise. + (c_parser_set_error): Likewise. + (c_parser_declspecs): Handle RID_GIMPLE. (c_parser_declaration_or_fndef): Parse __GIMPLE marked body via c_parser_parse_gimple_body. - * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token, - c_token_starts_typename, c_parser_next_token_starts_declspecs, - c_parser_next_tokens_start_declaration, c_parser_consume_token, - c_parser_error, c_parser_require, c_parser_skip_until_found, - c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, - c_parser_type_name): Declare. + * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token, + c_token_starts_typename, c_parser_next_token_starts_declspecs, + c_parser_next_tokens_start_declaration, c_parser_consume_token, + c_parser_error, c_parser_require, c_parser_skip_until_found, + c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, + c_parser_type_name): Declare. (struct c_parser): Declare forward. (c_parser_tokens_buf): Declare. - (c_parser_error): Likewise. - (c_parser_set_error): Likewise. - * gimple-parser.c: New file. - * gimple-parser.h: Likewise. + (c_parser_error): Likewise. + (c_parser_set_error): Likewise. + * gimple-parser.c: New file. + * gimple-parser.h: Likewise. 2016-09-11 Le-Chun Wu Mark Wielaard @@ -2159,13 +2159,13 @@ 2014-12-20 Martin Uecker * c-typeck.c: New behavious for pointers to arrays with qualifiers - (common-pointer-type): For pointers to arrays take qualifiers from + (common-pointer-type): For pointers to arrays take qualifiers from element type. - (build_conditional_expr): Add warnings for lost qualifiers. + (build_conditional_expr): Add warnings for lost qualifiers. (comp-target-types): Allow pointers to arrays with different qualifiers. - (convert-for-assignment): Adapt warnings for discarded qualifiers. Add + (convert-for-assignment): Adapt warnings for discarded qualifiers. Add WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS - to PEDWARN_FOR_QUALIFIERS. + to PEDWARN_FOR_QUALIFIERS. 2014-12-17 Jakub Jelinek @@ -2338,9 +2338,9 @@ 2014-10-13 Anthony Brandon - * c-parser.c (c_parser_all_labels): New function to replace + * c-parser.c (c_parser_all_labels): New function to replace the duplicate code. - (c_parser_statement): Call the new function. + (c_parser_statement): Call the new function. 2014-10-09 Marek Polacek diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 65574d3ee4b..1a92ffa0e4b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -3006,8 +3006,8 @@ 2016-03-21 Richard Henderson PR c++/70273 - * decl.c (notice_forced_label_r): New. - (cp_finish_decl): Use it. + * decl.c (notice_forced_label_r): New. + (cp_finish_decl): Use it. 2016-03-21 Jason Merrill diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 54eb9b3db08..1c3e66cdc8e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,29 +1,33 @@ +2016-11-14 Jakub Jelinek + + * g++.dg/cpp1z/feat-cxx1z.C: Test __cpp_structured_bindings macro. + 2016-11-14 Janus Weil PR fortran/78300 * gfortran.dg/class_result_3.f90: New test. 2016-11-14 Prasad Ghangal - Richard Biener - - * gcc.dg/gimplefe-1.c: New testcase. - * gcc.dg/gimplefe-2.c: Likewise. - * gcc.dg/gimplefe-3.c: Likewise. - * gcc.dg/gimplefe-4.c: Likewise. - * gcc.dg/gimplefe-5.c: Likewise. - * gcc.dg/gimplefe-6.c: Likewise. - * gcc.dg/gimplefe-7.c: Likewise. - * gcc.dg/gimplefe-8.c: Likewise. - * gcc.dg/gimplefe-9.c: Likewise. - * gcc.dg/gimplefe-10.c: Likewise. - * gcc.dg/gimplefe-11.c: Likewise. - * gcc.dg/gimplefe-12.c: Likewise. - * gcc.dg/gimplefe-13.c: Likewise. - * gcc.dg/gimplefe-14.c: Likewise. - * gcc.dg/gimplefe-15.c: Likewise. - * gcc.dg/gimplefe-16.c: Likewise. - * gcc.dg/gimplefe-17.c: Likewise. - * gcc.dg/gimplefe-18.c: Likewise. + Richard Biener + + * gcc.dg/gimplefe-1.c: New testcase. + * gcc.dg/gimplefe-2.c: Likewise. + * gcc.dg/gimplefe-3.c: Likewise. + * gcc.dg/gimplefe-4.c: Likewise. + * gcc.dg/gimplefe-5.c: Likewise. + * gcc.dg/gimplefe-6.c: Likewise. + * gcc.dg/gimplefe-7.c: Likewise. + * gcc.dg/gimplefe-8.c: Likewise. + * gcc.dg/gimplefe-9.c: Likewise. + * gcc.dg/gimplefe-10.c: Likewise. + * gcc.dg/gimplefe-11.c: Likewise. + * gcc.dg/gimplefe-12.c: Likewise. + * gcc.dg/gimplefe-13.c: Likewise. + * gcc.dg/gimplefe-14.c: Likewise. + * gcc.dg/gimplefe-15.c: Likewise. + * gcc.dg/gimplefe-16.c: Likewise. + * gcc.dg/gimplefe-17.c: Likewise. + * gcc.dg/gimplefe-18.c: Likewise. 2016-11-14 Martin Liska diff --git a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C index adbc32cf4ce..086fd25d893 100644 --- a/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C +++ b/gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C @@ -392,6 +392,12 @@ # error "__cpp_noexcept_function_type != 201510" #endif +#ifndef __cpp_structured_bindings +# error "__cpp_structured_bindings" +#elif __cpp_structured_bindings != 201606 +# error "__cpp_structured_bindings != 201606" +#endif + #ifdef __has_cpp_attribute # if ! __has_cpp_attribute(maybe_unused) -- 2.30.2