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
This commit is contained in:
Jakub Jelinek 2016-11-14 20:00:32 +01:00
parent bf166718a9
commit 8e745a1709
7 changed files with 116 additions and 101 deletions

View File

@ -1,6 +1,6 @@
2016-11-14 Thomas Preud'homme <thomas.preudhomme@arm.com> 2016-11-14 Thomas Preud'homme <thomas.preudhomme@arm.com>
* 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 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 expression in a endian independent way and then the ones not accessed
in the final result in an endian-specific way. in the final result in an endian-specific way.
@ -17,12 +17,12 @@
new line. new line.
2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> 2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
* doc/invoke.texi (fgimple): Document. * doc/invoke.texi (fgimple): Document.
* dumpfile.h (TDF_GIMPLE): Add. * dumpfile.h (TDF_GIMPLE): Add.
* dumpfile.c (dump_options): Add gimple. * dumpfile.c (dump_options): Add gimple.
* gimple-pretty-print.c (dump_gimple_switch): Adjust dump * gimple-pretty-print.c (dump_gimple_switch): Adjust dump
for TDF_GIMPLE. for TDF_GIMPLE.
(dump_gimple_label): Likewise. (dump_gimple_label): Likewise.
(dump_gimple_phi): Likewise. (dump_gimple_phi): Likewise.
@ -30,25 +30,25 @@
(dump_phi_nodes): Likewise. (dump_phi_nodes): Likewise.
(pp_cfg_jump): Likewise. Pass in dump flags. (pp_cfg_jump): Likewise. Pass in dump flags.
(dump_implicit_edges): Adjust. (dump_implicit_edges): Adjust.
* passes.c (pass_init_dump_file): Do not dump function header * passes.c (pass_init_dump_file): Do not dump function header
for TDF_GIMPLE. for TDF_GIMPLE.
* tree-cfg.c (dump_function_to_file): Dump function return type * tree-cfg.c (dump_function_to_file): Dump function return type
and __GIMPLE keyword for TDF_GIMPLE. Change guard for dumping and __GIMPLE keyword for TDF_GIMPLE. Change guard for dumping
GIMPLE stmts. GIMPLE stmts.
* tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE. * tree-pretty-print.c (dump_decl_name): Adjust dump for TDF_GIMPLE.
(dump_generic_node): Likewise. (dump_generic_node): Likewise.
* function.h (struct function): Add pass_startwith member. * function.h (struct function): Add pass_startwith member.
* passes.c (execute_one_pass): Implement startwith. * passes.c (execute_one_pass): Implement startwith.
* tree-ssanames.c (make_ssa_name_fn): New argument, check for version * tree-ssanames.c (make_ssa_name_fn): New argument, check for version
and assign proper version for parsed ssa names. and assign proper version for parsed ssa names.
* tree-ssanames.h (make_ssa_name_fn): Add new argument to the function. * tree-ssanames.h (make_ssa_name_fn): Add new argument to the function.
* internal-fn.c (expand_PHI): New function. * internal-fn.c (expand_PHI): New function.
* internal-fn.h (expand_PHI): Declared here. * internal-fn.h (expand_PHI): Declared here.
* internal-fn.def: New defination for PHI. * internal-fn.def: New defination for PHI.
* tree-cfg.c (lower_phi_internal_fn): New function. * tree-cfg.c (lower_phi_internal_fn): New function.
(build_gimple_cfg): Call it. (build_gimple_cfg): Call it.
(verify_gimple_call): Condition for passing label as arg in internal (verify_gimple_call): Condition for passing label as arg in internal
function PHI. function PHI.
* tree-into-ssa.c (rewrite_add_phi_arguments): Handle already * tree-into-ssa.c (rewrite_add_phi_arguments): Handle already
present PHIs with arguments. present PHIs with arguments.

View File

@ -1,9 +1,13 @@
2016-11-14 Jakub Jelinek <jakub@redhat.com>
* c-cppbuiltin.c (c_cpp_builtins): Define __cpp_structured_bindings.
2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> 2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
* c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types. * c-common.h (c_common_resword): Add RID_GIMPLE, RID_PHI types.
* c-common.h (enum rid): Add RID_GIMPLE, RID_PHI. * c-common.h (enum rid): Add RID_GIMPLE, RID_PHI.
* c.opt (fgimple): New option. * c.opt (fgimple): New option.
2016-11-13 Eric Botcazou <ebotcazou@adacore.com> 2016-11-13 Eric Botcazou <ebotcazou@adacore.com>
@ -590,7 +594,7 @@
Use a copy when emitting warnings, setting the caret index from TYPE. Use a copy when emitting warnings, setting the caret index from TYPE.
2016-08-16 Eric Botcazou <ebotcazou@adacore.com> 2016-08-16 Eric Botcazou <ebotcazou@adacore.com>
Arnaud Charlet <charlet@adacore.com> Arnaud Charlet <charlet@adacore.com>
* c-ada-spec.c (dump_number): New function. * c-ada-spec.c (dump_number): New function.
(handle_escape_character): Likewise. (handle_escape_character): Likewise.
@ -2511,7 +2515,7 @@
before trying to figure out whether we have a flexible array member. before trying to figure out whether we have a flexible array member.
2015-03-06 Eric Botcazou <ebotcazou@adacore.com> 2015-03-06 Eric Botcazou <ebotcazou@adacore.com>
Jonathan Wakely <jwakely.gcc@gmail.com> Jonathan Wakely <jwakely.gcc@gmail.com>
* c-ada-spec.c (dump_ada_double_name): Fix pasto. * c-ada-spec.c (dump_ada_double_name): Fix pasto.
@ -4033,15 +4037,15 @@
that lower floating point number precision or about the other that lower floating point number precision or about the other
kinds of conversions. kinds of conversions.
* c-common.h (enum conversion_safety): New enumeration. * c-common.h (enum conversion_safety): New enumeration.
(unsafe_conversion_p): switching return type to (unsafe_conversion_p): switching return type to
conversion_safety enumeration. conversion_safety enumeration.
* c.opt: Adding new warning -Wfloat-conversion and * c.opt: Adding new warning -Wfloat-conversion and
enabling it with -Wconversion. enabling it with -Wconversion.
2013-11-19 Basile Starynkevitch <basile@starynkevitch.net> 2013-11-19 Basile Starynkevitch <basile@starynkevitch.net>
* c-opts.c: Include plugin.h. * c-opts.c: Include plugin.h.
(cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE. (cb_file_change): Invoke plugin event PLUGIN_INCLUDE_FILE.
2013-11-19 Marek Polacek <polacek@redhat.com> 2013-11-19 Marek Polacek <polacek@redhat.com>
@ -4261,7 +4265,7 @@
2013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net> 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 * c-lex.c (interpret_float): Remove digit separators from scratch string
before building real literal. before building real literal.
@ -4829,7 +4833,7 @@
__GXX_EXPERIMENTAL_CXX1Y__. __GXX_EXPERIMENTAL_CXX1Y__.
2013-04-24 Paolo Carlini <paolo.carlini@oracle.com> 2013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
Manuel Lopez-Ibanez <manu@gcc.gnu.org> Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented. * c.opt ([Wpointer-arith]): Enabled by -Wpedantic, as documented.
* c-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns * c-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns
@ -4970,7 +4974,7 @@
PR 55139 PR 55139
* c-common.c (get_atomic_generic_size): Mask with * c-common.c (get_atomic_generic_size): Mask with
MEMMODEL_MASK MEMMODEL_MASK
2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org> 2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>
@ -4984,16 +4988,16 @@
* c-opts.c (c_common_handle_option): Do not handle Wformat here. * c-opts.c (c_common_handle_option): Do not handle Wformat here.
* c-format.c (set_Wformat): Delete. * c-format.c (set_Wformat): Delete.
(decode_format_attr): Replace OPT_Wformat with OPT_Wformat_. (decode_format_attr): Replace OPT_Wformat with OPT_Wformat_.
(maybe_read_dollar_number): Likewise. (maybe_read_dollar_number): Likewise.
(avoid_dollar_number): Likewise. (avoid_dollar_number): Likewise.
(finish_dollar_format_checking): Likewise. (finish_dollar_format_checking): Likewise.
(check_format_info): Likewise. (check_format_info): Likewise.
(check_format_info_main): Likewise. (check_format_info_main): Likewise.
(check_format_types): Likewise. (check_format_types): Likewise.
(format_type_warning): Likewise. (format_type_warning): Likewise.
* c-common.c (int): Likewise. * c-common.c (int): Likewise.
(check_function_sentinel): Likewise. (check_function_sentinel): Likewise.
* c-common.h (warn_format,set_Wformat): Do not declare here. * c-common.h (warn_format,set_Wformat): Do not declare here.
2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org> 2012-11-07 Manuel López-Ibáñez <manu@gcc.gnu.org>

View File

@ -943,6 +943,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_deduction_guides=201606"); cpp_define (pfile, "__cpp_deduction_guides=201606");
cpp_define (pfile, "__cpp_noexcept_function_type=201510"); cpp_define (pfile, "__cpp_noexcept_function_type=201510");
cpp_define (pfile, "__cpp_template_auto=201606"); cpp_define (pfile, "__cpp_template_auto=201606");
cpp_define (pfile, "__cpp_structured_bindings=201606");
} }
if (flag_concepts) if (flag_concepts)
cpp_define (pfile, "__cpp_concepts=201507"); cpp_define (pfile, "__cpp_concepts=201507");

View File

@ -1,41 +1,41 @@
2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> 2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
* Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o. * Make-lang.in (C_AND_OBJC_OBJS): Add gimple-parser.o.
* config-lang.in (gtfiles): Add c/c-parser.h. * config-lang.in (gtfiles): Add c/c-parser.h.
* c-tree.h (enum c_declspec_word): Add cdw_gimple. * c-tree.h (enum c_declspec_word): Add cdw_gimple.
(struct c_declspecs): Add gimple_pass member and gimple_p flag. (struct c_declspecs): Add gimple_pass member and gimple_p flag.
* c-parser.c (enum c_id_kind, struct c_token, * 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, c_parser_next_token_is_not,
c_parser_next_token_is_keyword, c_parser_next_token_is_keyword,
enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec): enum c_lookahead_kind, enum c_dtr_syn, enum c_parser_prec):
Split out to ... Split out to ...
* c-parser.h: ... new header. * c-parser.h: ... new header.
* c-parser.c: Include c-parser.h and gimple-parser.h. * c-parser.c: Include c-parser.h and gimple-parser.h.
(c_parser_peek_token, c_parser_peek_2nd_token, (c_parser_peek_token, c_parser_peek_2nd_token,
c_token_starts_typename, c_parser_next_token_starts_declspecs, c_token_starts_typename, c_parser_next_token_starts_declspecs,
c_parser_next_tokens_start_declaration, c_parser_consume_token, c_parser_next_tokens_start_declaration, c_parser_consume_token,
c_parser_error, c_parser_require, c_parser_skip_until_found, c_parser_error, c_parser_require, c_parser_skip_until_found,
c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
c_parser_type_name): Export. c_parser_type_name): Export.
(c_parser_tokens_buf): New function. (c_parser_tokens_buf): New function.
(c_parser_error): Likewise. (c_parser_error): Likewise.
(c_parser_set_error): Likewise. (c_parser_set_error): Likewise.
(c_parser_declspecs): Handle RID_GIMPLE. (c_parser_declspecs): Handle RID_GIMPLE.
(c_parser_declaration_or_fndef): Parse __GIMPLE marked body (c_parser_declaration_or_fndef): Parse __GIMPLE marked body
via c_parser_parse_gimple_body. via c_parser_parse_gimple_body.
* c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token, * c-parser.h (c_parser_peek_token, c_parser_peek_2nd_token,
c_token_starts_typename, c_parser_next_token_starts_declspecs, c_token_starts_typename, c_parser_next_token_starts_declspecs,
c_parser_next_tokens_start_declaration, c_parser_consume_token, c_parser_next_tokens_start_declaration, c_parser_consume_token,
c_parser_error, c_parser_require, c_parser_skip_until_found, c_parser_error, c_parser_require, c_parser_skip_until_found,
c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token, c_parser_declspecs, c_parser_declarator, c_parser_peek_nth_token,
c_parser_type_name): Declare. c_parser_type_name): Declare.
(struct c_parser): Declare forward. (struct c_parser): Declare forward.
(c_parser_tokens_buf): Declare. (c_parser_tokens_buf): Declare.
(c_parser_error): Likewise. (c_parser_error): Likewise.
(c_parser_set_error): Likewise. (c_parser_set_error): Likewise.
* gimple-parser.c: New file. * gimple-parser.c: New file.
* gimple-parser.h: Likewise. * gimple-parser.h: Likewise.
2016-09-11 Le-Chun Wu <lcwu@google.com> 2016-09-11 Le-Chun Wu <lcwu@google.com>
Mark Wielaard <mjw@redhat.com> Mark Wielaard <mjw@redhat.com>
@ -2159,13 +2159,13 @@
2014-12-20 Martin Uecker <uecker@eecs.berkeley.edu> 2014-12-20 Martin Uecker <uecker@eecs.berkeley.edu>
* c-typeck.c: New behavious for pointers to arrays with qualifiers * 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. 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. (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 WARNING_FOR_QUALIFIERS macro and rename WARN_FOR_QUALIFIERS
to PEDWARN_FOR_QUALIFIERS. to PEDWARN_FOR_QUALIFIERS.
2014-12-17 Jakub Jelinek <jakub@redhat.com> 2014-12-17 Jakub Jelinek <jakub@redhat.com>
@ -2338,9 +2338,9 @@
2014-10-13 Anthony Brandon <anthony.brandon@gmail.com> 2014-10-13 Anthony Brandon <anthony.brandon@gmail.com>
* 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. the duplicate code.
(c_parser_statement): Call the new function. (c_parser_statement): Call the new function.
2014-10-09 Marek Polacek <polacek@redhat.com> 2014-10-09 Marek Polacek <polacek@redhat.com>

View File

@ -3006,8 +3006,8 @@
2016-03-21 Richard Henderson <rth@redhat.com> 2016-03-21 Richard Henderson <rth@redhat.com>
PR c++/70273 PR c++/70273
* decl.c (notice_forced_label_r): New. * decl.c (notice_forced_label_r): New.
(cp_finish_decl): Use it. (cp_finish_decl): Use it.
2016-03-21 Jason Merrill <jason@redhat.com> 2016-03-21 Jason Merrill <jason@redhat.com>

View File

@ -1,29 +1,33 @@
2016-11-14 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp1z/feat-cxx1z.C: Test __cpp_structured_bindings macro.
2016-11-14 Janus Weil <janus@gcc.gnu.org> 2016-11-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/78300 PR fortran/78300
* gfortran.dg/class_result_3.f90: New test. * gfortran.dg/class_result_3.f90: New test.
2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com> 2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
Richard Biener <rguenther@suse.de> Richard Biener <rguenther@suse.de>
* gcc.dg/gimplefe-1.c: New testcase. * gcc.dg/gimplefe-1.c: New testcase.
* gcc.dg/gimplefe-2.c: Likewise. * gcc.dg/gimplefe-2.c: Likewise.
* gcc.dg/gimplefe-3.c: Likewise. * gcc.dg/gimplefe-3.c: Likewise.
* gcc.dg/gimplefe-4.c: Likewise. * gcc.dg/gimplefe-4.c: Likewise.
* gcc.dg/gimplefe-5.c: Likewise. * gcc.dg/gimplefe-5.c: Likewise.
* gcc.dg/gimplefe-6.c: Likewise. * gcc.dg/gimplefe-6.c: Likewise.
* gcc.dg/gimplefe-7.c: Likewise. * gcc.dg/gimplefe-7.c: Likewise.
* gcc.dg/gimplefe-8.c: Likewise. * gcc.dg/gimplefe-8.c: Likewise.
* gcc.dg/gimplefe-9.c: Likewise. * gcc.dg/gimplefe-9.c: Likewise.
* gcc.dg/gimplefe-10.c: Likewise. * gcc.dg/gimplefe-10.c: Likewise.
* gcc.dg/gimplefe-11.c: Likewise. * gcc.dg/gimplefe-11.c: Likewise.
* gcc.dg/gimplefe-12.c: Likewise. * gcc.dg/gimplefe-12.c: Likewise.
* gcc.dg/gimplefe-13.c: Likewise. * gcc.dg/gimplefe-13.c: Likewise.
* gcc.dg/gimplefe-14.c: Likewise. * gcc.dg/gimplefe-14.c: Likewise.
* gcc.dg/gimplefe-15.c: Likewise. * gcc.dg/gimplefe-15.c: Likewise.
* gcc.dg/gimplefe-16.c: Likewise. * gcc.dg/gimplefe-16.c: Likewise.
* gcc.dg/gimplefe-17.c: Likewise. * gcc.dg/gimplefe-17.c: Likewise.
* gcc.dg/gimplefe-18.c: Likewise. * gcc.dg/gimplefe-18.c: Likewise.
2016-11-14 Martin Liska <mliska@suse.cz> 2016-11-14 Martin Liska <mliska@suse.cz>

View File

@ -392,6 +392,12 @@
# error "__cpp_noexcept_function_type != 201510" # error "__cpp_noexcept_function_type != 201510"
#endif #endif
#ifndef __cpp_structured_bindings
# error "__cpp_structured_bindings"
#elif __cpp_structured_bindings != 201606
# error "__cpp_structured_bindings != 201606"
#endif
#ifdef __has_cpp_attribute #ifdef __has_cpp_attribute
# if ! __has_cpp_attribute(maybe_unused) # if ! __has_cpp_attribute(maybe_unused)