c-cppbuiltin.c (c_cpp_builtins): Define __cpp_structured_bindings.
authorJakub Jelinek <jakub@gcc.gnu.org>
Mon, 14 Nov 2016 19:00:32 +0000 (20:00 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 14 Nov 2016 19:00:32 +0000 (20:00 +0100)
* 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
gcc/c-family/ChangeLog
gcc/c-family/c-cppbuiltin.c
gcc/c/ChangeLog
gcc/cp/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/feat-cxx1z.C

index f259470e9fabcedd8a300c3d59981bbf4e5ff35e..fd132b5acef60dac84d45c032298417618993b6b 100644 (file)
@@ -1,6 +1,6 @@
 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
        expression in a endian independent way and then the ones not accessed
        in the final result in an endian-specific way.
        new line.
 
 2016-11-14  Prasad Ghangal  <prasad.ghangal@gmail.com>
-       Richard Biener  <rguenther@suse.de>
+           Richard Biener  <rguenther@suse.de>
     
        * 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.
        (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.
 
index 2360d9ed17c6e2cc4ed2af6d27b081d88a601009..cb1b35c86e5f6f2cb147e003eba3a6d397abb83b 100644 (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>
-       Richard Biener  <rguenther@suse.de>
-    
-       * 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  <rguenther@suse.de>
+
+       * 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  <ebotcazou@adacore.com>
 
        Use a copy when emitting warnings, setting the caret index from TYPE.
 
 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.
        (handle_escape_character): Likewise.
        before trying to figure out whether we have a flexible array member.
 
 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.
 
        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  <basile@starynkevitch.net>
 
-        * 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  <polacek@redhat.com>
 
 
 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.
 
        __GXX_EXPERIMENTAL_CXX1Y__.
 
 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-common.c (pointer_int_sum): Change -Wpointer-arith pedwarns
 
        PR 55139
        * 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>
 
        * 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  <manu@gcc.gnu.org>
 
index 70eade170e6417eed3666c9f2d5aaceb808dff4a..5c88e91e9e34f578831afae312bc76548d5ecb81 100644 (file)
@@ -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");
index 75f39d7ed8b40a78083be1d64d508fa77a731952..1cb30e719bff6a392c767503bcf385ce889e1118 100644 (file)
@@ -1,41 +1,41 @@
 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.
-       * 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  <lcwu@google.com>
            Mark Wielaard  <mjw@redhat.com>
 2014-12-20  Martin Uecker  <uecker@eecs.berkeley.edu>
 
        * 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  <jakub@redhat.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.
-        (c_parser_statement): Call the new function.
+       (c_parser_statement): Call the new function.
 
 2014-10-09  Marek Polacek  <polacek@redhat.com>
 
index 65574d3ee4b81016d8750b27a90c5a2c158af804..1a92ffa0e4ba13b5719a5859874ba7758f40f347 100644 (file)
 2016-03-21  Richard Henderson  <rth@redhat.com>
 
        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  <jason@redhat.com>
 
index 54eb9b3db0810dac37a04ff67ff6a52d26061a93..1c3e66cdc8e9d0782ddb45b5e9a9b55e1752d75b 100644 (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>
 
        PR fortran/78300
        * gfortran.dg/class_result_3.f90: New test.
 
 2016-11-14  Prasad Ghangal  <prasad.ghangal@gmail.com>
-       Richard Biener  <rguenther@suse.de>
-
-       * 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  <rguenther@suse.de>
+
+       * 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  <mliska@suse.cz>
 
index adbc32cf4ce4c10e20a06d2a97330b776c9ce93d..086fd25d8932f80984cebdb4064466cf254281f0 100644 (file)
 #  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)