Implement P0217R3 - C++17 structured bindings
* g++.dg/cpp1z/decomp1.C: New test.
* g++.dg/cpp1z/decomp2.C: New test.
* g++.dg/cpp1z/decomp3.C: New test.
* g++.dg/cpp1z/decomp4.C: New test.
* g++.dg/cpp1z/decomp5.C: New test.
* g++.dg/cpp1z/decomp6.C: New test.
* g++.dg/cpp1z/decomp7.C: New test.
* g++.dg/cpp1z/decomp8.C: New test.
* g++.dg/cpp1z/decomp9.C: New test.
* g++.dg/cpp1z/decomp10.C: New test.
Co-Authored-By: Jason Merrill <jason@redhat.com>
From-SVN: r242378
* call.c (build_new_method_call_1): Include template arguments in
error message.
(print_error_for_call_failure): Likewise.
(build_new_function_call): Pass them in.
* name-lookup.c (supplement_binding_1): Don't complain about a
conflict with an erroneous declaration.
* error.c (dump_decl): Fix printing of alias declaration.
* decl.c (make_typename_type): Call cxx_incomplete_type_error.
* parser.c (cp_parser_diagnose_invalid_type_name): Likewise.
* semantics.c (perform_koenig_lookup): Don't wrap an error in
TEMPLATE_ID_EXPR.
From-SVN: r242376
* doc/xml/manual/status_cxx2017.xml: Update status.
* doc/html/manual/status.html: Regenerate.
* include/bits/shared_ptr.h (shared_ptr(unique_ptr<_Yp, _Del>)): Add
extension constructor to maintain C++14 behaviour.
* include/bits/shared_ptr_base.h (__sp_array_delete): Add new struct.
(__shared_count(_Ptr, false_type), __shared_count(_Ptr, true_type)):
New constructors.
(__sp_compatible_with, __sp_is_constructible): Add specializations
for array support.
(__sp_is_constructible_arr, __sp_is_constructible_arrN): New helpers.
(__shared_ptr_access): New base class for observer member functions.
(__shared_ptr::element_type): Use remove_extent.
(__shared_ptr::_UniqCompatible): Add __sp_compatible_with check.
(__shared_ptr(_Yp*)): Use tag dispatching to call new __shared_count
constructor.
(__shared_ptr(unique_ptr<_Yp, _Del>)): Add extension constructor.
(__shared_ptr::operator*, __shared_ptr::operator->): Remove and
inherit from __shared_ptr_access base class.
(__shared_ptr::__has_esft_base): Return false for array types.
(__weak_ptr::element_type): Use remove_extent.
* include/experimental/bits/shared_ptr.h (__libfund_v1): Remove.
(__shared_ptr<__libfund_v1<_Tp>>): Remove specializations.
(__wak_ptr<__libfund_v1<_Tp>>): Likewise.
(experimental::__sp_compatible_v): Redefine using
__sp_compatible_with.
(experimental::__sp_is_constructible_v): Redefine using
__sp_is_constructible.
(get_deleter, operator<<): Change argument from __shared_ptr to
shared_ptr.
* testsuite/20_util/shared_ptr/cons/array.cc: New test.
* testsuite/20_util/shared_ptr/cons/unique_ptr_array.cc: Adjust for
new behaviour.
* testsuite/20_util/shared_ptr/observers/array.cc: Test observers for
arrays.
* testsuite/20_util/shared_ptr/observers/array_neg.cc: New test.
From-SVN: r242369
* gcc-interface/decl.c (gnat_to_gnu_entity): In assertion about known
Esize, protect with !is_type and change !Unknown_Esize to Known_Esize.
From-SVN: r242363
* gcc-interface/utils2.c (gnat_protect_expr): Also protect only the
address if the expression is the component of a dereference.
Do not use a reference type for the final temporary reference.
From-SVN: r242358
* c-ada-spec.c (print_ada_declaration): For typedef declarations, look
for nested types only if the type is a record or union and dump SLOC.
From-SVN: r242356
2016-11-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/60952
* decl.c (match_procedure_in_type): Apply the FL_PROCEDURE attribute
to the target procedure.
2016-11-13 Janus Weil <janus@gcc.gnu.org>
PR fortran/60952
* gfortran.dg/typebound_proc_34.f90: New test.
From-SVN: r242352
The code generating traceback tables mistakenly does an early return
if !optional_tbtab, which causes it to miss the code generating the TOC
section. This only matters if the TOC will be empty since otherwise
the section is created elsewhere.
This patch fixes it.
PR target/77957
* config/rs6000/rs6000.c (rs6000_output_function_epilogue): Don't
return early if !optional_tbtab.
From-SVN: r242336
2016-11-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/77501
* class.c (gfc_find_typebound_intrinsic_op): Remove an unnecessary
assert and nullification.
* decl.c (gfc_match_decl_type_spec): Use gfc_get_tbp_symtree,
fix indentation.
(gfc_match_generic): Remove an unnecessary assert.
Use gfc_get_tbp_symtree to avoid ICE.
2016-11-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/77501
* gfortran.dg/typebound_generic_16.f90: New test.
From-SVN: r242335
PR rtl-optimization/59461
* doc/rtl.texi (paradoxical subregs): Add missing word.
* combine.c (reg_nonzero_bits_for_combine): Do not discard results
in modes with precision larger than that of last_set_mode.
* rtlanal.c (nonzero_bits1) <SUBREG>: If WORD_REGISTER_OPERATIONS is
set and LOAD_EXTEND_OP is appropriate, propagate results from inner
REGs to paradoxical SUBREGs.
(num_sign_bit_copies1) <SUBREG>: Likewise. Check that the mode is not
larger than a word before invoking LOAD_EXTEND_OP on it.
From-SVN: r242326
* config/i386/i386.md (*<shift_insn><mode>3_doubleword): Mark
operand 0 as earlyclobber.
(*ashl<mode>3_doubleword): Ditto for all operand 0 alternatives.
From-SVN: r242318
2016-11-11 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/78243
* config/rs6000/vsx.md (vsx_extract_<mode>_p9): Correct the
element order for little endian ordering.
* config/rs6000/altivec.md (reduc_plus_scal_<mode>): Use
VECTOR_ELT_ORDER_BIG and not BYTES_BIG_ENDIAN to adjust element
number.
From-SVN: r242317
The __cpu_indicator_init and __cpu_model symbols are not safe to use
from shared libgcc_s.so from ifunc resolvers, so since gcc-6, only
the definitions from static libgcc.a are used, however the symbols
are kept in libgcc_s as well for backward compatibility (with
appropriate symbol version). On targets without such backward
compatibility concern add cpuinfo to the static library only (this
avoids running the ctor, reduces libgcc_s size and elf abi concerns
about the versioned symbols).
libgcc/
2016-11-11 Szabolcs Nagy <szabolcs.nagy@arm.com>
* config.host (i[3456]86-*-musl*, x86_64-*-musl*): Use
i386/t-cpuinfo-static instead of i386/t-cpuinfo.
* config/i386/t-cpuinfo-static: New.
From-SVN: r242268
* gimple-ssa-isolate-paths.c (is_divmod_with_given_divisor): New
function.
(stmt_uses_name_in_undefined_way): New function, extracted from
find_implicit_erroneous_behavior and extended for div/mod case.
(stmt_uses_0_or_null_in_undefined_way): New function, extracted from
find_explicit_erroneous_behavior and extended for div/mod case.
(find_implicit_erroneous_behavior): Use new helper function.
(find_explicit_erroneous_behavior): Use new helper function.
* gcc.dg/tree-ssa/isolate-6.c: New test.
* gcc.dg/tree-ssa/isolate-7.c: New test.
From-SVN: r242075