aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
AgeCommit message (Collapse)AuthorFilesLines
2018-10-03Implement P0840, language support for empty objects.Jason Merrill1-53/+127
The [[no_unique_address]] attribute on a non-static data member enables the equivalent of the empty base optimization. gcc/cp/ * tree.c (handle_no_unique_addr_attribute): New. (cxx_attribute_table): Add [[no_unique_address]]. * class.c (field_poverlapping_p): New. (layout_class_type): Check it. Adjust DECL_SIZE of potentially overlapping fields. (layout_empty_base_or_field): Rename from layout_empty_base, handle FIELD_DECL as well. (build_base_field, record_subobject_offsets): Adjust. c-family/ * c-lex.c (c_common_has_attribute): Add no_unique_address. From-SVN: r264813
2018-09-18P1064R0 - Allowing Virtual Function Calls in Constant ExpressionsMarek Polacek1-3/+4
P1064R0 - Allowing Virtual Function Calls in Constant Expressions * call.c (build_over_call): No longer check if we're outside a template function. * class.c (build_vtbl_initializer): Build vtable's constructor with indexes. * constexpr.c (cxx_eval_constant_expression): Don't ignore _vptr's initializer. Handle OBJ_TYPE_REF. (potential_constant_expression_1): Handle OBJ_TYPE_REF. * decl.c (maybe_commonize_var): Bail out for any DECL_ARTIFICIAL. (initialize_artificial_var): Mark the variable as constexpr. (grokdeclarator): Change error to pedwarn. Only warn when pedantic and not C++2a. * gimple-fold.c (gimple_get_virt_method_for_vtable): Adjust assert. * g++.dg/cpp0x/constexpr-virtual5.C: Adjust dg-error. * g++.dg/cpp2a/constexpr-virtual1.C: New test. * g++.dg/cpp2a/constexpr-virtual2.C: New test. * g++.dg/cpp2a/constexpr-virtual3.C: New test. * g++.dg/cpp2a/constexpr-virtual4.C: New test. * g++.dg/cpp2a/constexpr-virtual5.C: New test. * g++.dg/cpp2a/constexpr-virtual6.C: New test. * g++.dg/cpp2a/constexpr-virtual7.C: New test. * g++.dg/cpp2a/constexpr-virtual8.C: New test. * g++.dg/cpp2a/constexpr-virtual9.C: New test. * g++.dg/diagnostic/virtual-constexpr.C: Skip for C++2a. Use -pedantic-errors. Adjust dg-error. From-SVN: r264408
2018-09-10class.c (build_vtbl_ref): Remove.Marek Polacek1-13/+3
* class.c (build_vtbl_ref): Remove. (build_vtbl_ref_1): Rename to build_vtbl_ref. (build_vfn_ref): Call build_vtbl_ref instead of build_vtbl_ref_1. From-SVN: r264193
2018-08-20Add support for grouping of related diagnostics (PR other/84889)David Malcolm1-28/+47
We often emit logically-related groups of diagnostics. A relatively simple case is this: if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); where the "note" diagnostic issued by the "inform" call is guarded by the -Wmultistatement_macros warning. More complicated examples can be seen in the C++ frontend, where e.g. print_z_candidates can lead to numerous "note" diagnostics being emitted. I'm looking at various ways to improve how we handle such related diagnostics, but, prior to this patch, there was no explicit relationship between these diagnostics: the diagnostics subsystem had no way of "knowing" that these were related. This patch introduces a simple way to group the diagnostics: an auto_diagnostic_group class: all diagnostics emitted within the lifetime of an auto_diagnostic_group instance are logically grouped. Hence in the above example, the two diagnostics can be grouped by simply adding an auto_diagnostic_group instance: auto_diagnostic_group d; if (warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); Some more awkard cases are of the form: if (some_condition && warning_at (...) && more_conditions) inform (...); which thus need restructuring to: if (some_condition) { auto_diagnostic_group d; warning_at (...); if (more_conditions) inform (...); } so that the lifetime of the auto_diagnostic_group groups the warning_at and the inform call. Nesting is handled by simply tracking a nesting depth within the diagnostic_context.: all diagnostics are treated as grouped until the final auto_diagnostic_group is popped. diagnostic.c uses this internally, so that all diagnostics are part of a group - those that are "by themselves" are treated as being part of a group with one element. The diagnostic_context gains optional callbacks for displaying the start of a group (when the first diagnostic is emitted within it), and the end of a group (for when the group was non-empty); these callbacks are unused by default, but a test plugin demonstrates them (and verifies that the machinery is working). As noted above, I'm looking at various ways to use the grouping to improve how we output the diagnostics. FWIW, I experimented with a more involved implementation, of the form: diagnostic_group d; if (d.warning_at (body_loc, OPT_Wmultistatement_macros, "macro expands to multiple statements")) d.inform (guard_loc, "some parts of macro expansion are not guarded by " "this %qs clause", guard_tinfo_to_string (keyword)); which had the advantage of allowing auto-detection of the places where groups were needed (by converting ::warning_at's return type to bool), but it was a much more invasive patch, especially when dealing with the places in the C++ frontend that can emit numerous notes after an error or warning (and thus having to pass the group around) Hence I went with this simpler approach. gcc/c-family/ChangeLog: PR other/84889 * c-attribs.c (common_handle_aligned_attribute): Add auto_diagnostic_group instance. * c-indentation.c (warn_for_misleading_indentation): Likewise. * c-opts.c (c_common_post_options): Likewise. * c-warn.c (warn_logical_not_parentheses): Likewise. (warn_duplicated_cond_add_or_warn): Likewise. (warn_for_multistatement_macros): Likewise. gcc/c/ChangeLog: PR other/84889 * c-decl.c (pushtag): Add auto_diagnostic_group instance. (diagnose_mismatched_decls): Likewise, in various places. (warn_if_shadowing): Likewise. (implicit_decl_warning): Likewise. (implicitly_declare): Likewise. (undeclared_variable): Likewise. (declare_label): Likewise. (grokdeclarator): Likewise. (start_function): Likewise. * c-parser.c (c_parser_declaration_or_fndef): Likewise. (c_parser_parameter_declaration): Likewise. (c_parser_binary_expression): Likewise. * c-typeck.c (c_expr_sizeof_expr): Likewise. (parser_build_binary_op): Likewise. (build_unary_op): Likewise. (error_init): Likewise. (pedwarn_init): Likewise. (warning_init): Likewise. (convert_for_assignment): Likewise. gcc/cp/ChangeLog: PR other/84889 * call.c (build_user_type_conversion_1): Add auto_diagnostic_group instance(s). (print_error_for_call_failure): Likewise. (build_op_call_1): Likewise. (build_conditional_expr_1): Likewise. (build_new_op_1): Likewise. (build_op_delete_call): Likewise. (convert_like_real): Likewise. (build_over_call): Likewise. (build_new_method_call_1): Likewise. (joust): Likewise. * class.c (check_tag): Likewise. (finish_struct_anon_r): Likewise. (one_inherited_ctor): Likewise. (finalize_literal_type_property): Likewise. (explain_non_literal_class): Likewise. (find_flexarrays): Likewise. (resolve_address_of_overloaded_function): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. (is_valid_constexpr_fn): Likewise. (cx_check_missing_mem_inits): Likewise. * cp-gimplify.c (cp_genericize_r): Likewise. * cvt.c (maybe_warn_nodiscard): Likewise. * decl.c (warn_extern_redeclared_static): Likewise. (check_redeclaration_exception_specification): Likewise. (check_no_redeclaration_friend_default_args): Likewise. (duplicate_decls): Likewise. (redeclaration_error_message): Likewise. (warn_misplaced_attr_for_class_type): Likewise. * decl2.c (finish_static_data_member_decl): Likewise. (no_linkage_error): Likewise. (cp_warn_deprecated_use): Likewise. * error.c (qualified_name_lookup_error): Likewise. * friend.c (make_friend_class): Likewise. (do_friend): Likewise. * init.c (perform_member_init): Likewise. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_delete): Likewise. * lex.c (unqualified_name_lookup_error): Likewise. * name-lookup.c (check_extern_c_conflict): Likewise. (inform_shadowed): New function. (check_local_shadow): Add auto_diagnostic_group instances, replacing goto "inform_shadowed" label with call to subroutine. (set_local_extern_decl_linkage): Add auto_diagnostic_group instance(s). * parser.c (cp_parser_diagnose_invalid_type_name): Likewise. (cp_parser_namespace_name): Likewise. * pt.c (check_specialization_namespace): Likewise. (check_template_variable): Likewise. (warn_spec_missing_attributes): Likewise. (check_explicit_specialization): Likewise. (process_partial_specialization): Likewise. (lookup_template_class_1): Likewise. (finish_template_variable): Likewise. (do_auto_deduction): Likewise. * search.c (check_final_overrider): Likewise. (look_for_overrides_r): Likewise. * tree.c (maybe_warn_parm_abi): Likewise. * typeck.c (cxx_sizeof_expr): Likewise. (cp_build_function_call_vec): Likewise. (cp_build_binary_op): Likewise. (convert_for_assignment): Likewise. (maybe_warn_about_returning_address_of_local): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. (check_narrowing): Likewise. gcc/ChangeLog: PR other/84889 * attribs.c (diag_attr_exclusions): Add auto_diagnostic_group instance. (decl_attributes): Likewise. * calls.c (maybe_warn_nonstring_arg): Add auto_diagnostic_group instance. * cgraphunit.c (maybe_diag_incompatible_alias): Likewise. * diagnostic-core.h (class auto_diagnostic_group): New class. * diagnostic.c (diagnostic_initialize): Initialize the new fields. (diagnostic_report_diagnostic): Handle the first diagnostics within a group. (emit_diagnostic): Add auto_diagnostic_group instance. (inform): Likewise. (inform_n): Likewise. (warning): Likewise. (warning_at): Likewise. (warning_n): Likewise. (pedwarn): Likewise. (permerror): Likewise. (error): Likewise. (error_n): Likewise. (error_at): Likewise. (sorry): Likewise. (fatal_error): Likewise. (internal_error): Likewise. (internal_error_no_backtrace): Likewise. (auto_diagnostic_group::auto_diagnostic_group): New ctor. (auto_diagnostic_group::~auto_diagnostic_group): New dtor. * diagnostic.h (struct diagnostic_context): Add fields "diagnostic_group_nesting_depth", "diagnostic_group_emission_count", "begin_group_cb", "end_group_cb". * gimple-ssa-isolate-paths.c (find_implicit_erroneous_behavior): Add auto_diagnostic_group instance(s). (find_explicit_erroneous_behavior): Likewise. * gimple-ssa-warn-alloca.c (pass_walloca::execute): Likewise. * gimple-ssa-warn-restrict.c (maybe_diag_offset_bounds): Likewise. * gimplify.c (warn_implicit_fallthrough_r): Likewise. (gimplify_va_arg_expr): Likewise. * hsa-gen.c (HSA_SORRY_ATV): Likewise. (HSA_SORRY_AT): Likewise. * ipa-devirt.c (compare_virtual_tables): Likewise. (warn_odr): Likewise. * multiple_target.c (expand_target_clones): Likewise. * opts-common.c (cmdline_handle_error): Likewise. * reginfo.c (globalize_reg): Likewise. * substring-locations.c (format_warning_n_va): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-ssa-ccp.c (pass_post_ipa_warn::execute): Likewise. * tree-ssa-loop-niter.c (do_warn_aggressive_loop_optimizations): Likewise. * tree-ssa-uninit.c (warn_uninit): Likewise. * tree.c (warn_deprecated_use): Likewise. gcc/testsuite/ChangeLog: PR other/84889 * gcc.dg/plugin/diagnostic-group-test-1.c: New test. * gcc.dg/plugin/diagnostic_group_plugin.c: New test. * gcc.dg/plugin/plugin.exp (plugin_test_list): Add the new tests. From-SVN: r263675
2018-08-03re PR c++/86706 (ICE in build_base_path, at cp/class.c:294)Jason Merrill1-0/+3
PR c++/86706 * class.c (build_base_path): Use currently_open_class. * g++.dg/template/pr86706.C: New test. From-SVN: r263293
2018-08-02re PR c++/86763 (Wrong code comparing member of copy of a 237 byte object ↵Richard Biener1-0/+1
with nontrivial default constructor on x86-64 arch) 2018-08-02 Richard Biener <rguenther@suse.de> PR c++/86763 * class.c (layout_class_type): Copy TYPE_TYPELESS_STORAGE to the CLASSTYPE_AS_BASE. * g++.dg/torture/pr86763.C: New testcase. From-SVN: r263261
2018-08-01re PR c++/86661 (g++ ICE:tree check: expected tree that contains ‘decl ↵Paolo Carlini1-1/+1
minimal’ structure, have ‘overload’ in note_name_declared_in_class, at cp/class.c:8288) /cp 2018-08-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/86661 * class.c (note_name_declared_in_class): Use location_of in permerror instead of DECL_SOURCE_LOCATION (for OVERLOADs). /testsuite 2018-08-01 Paolo Carlini <paolo.carlini@oracle.com> PR c++/86661 * g++.dg/lookup/name-clash12.C: New. From-SVN: r263207
2018-07-31P1008R1 - prohibit aggregates with user-declared constructorsJakub Jelinek1-1/+3
P1008R1 - prohibit aggregates with user-declared constructors * class.c (check_bases_and_members): For C++2a set CLASSTYPE_NON_AGGREGATE based on TYPE_HAS_USER_CONSTRUCTOR rather than type_has_user_provided_or_explicit_constructor. * g++.dg/ext/is_aggregate.C: Add tests with deleted or defaulted ctor. * g++.dg/cpp0x/defaulted1.C (main): Ifdef out for C++2a B b = {1};. * g++.dg/cpp0x/deleted2.C: Expect error for C++2a. * g++.dg/cpp2a/aggr1.C: New test. * g++.dg/cpp2a/aggr2.C: New test. From-SVN: r263115
2018-07-25cp-tree.h (enum cp_tree_index): Add ↵Jakub Jelinek1-4/+2
CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER and... * cp-tree.h (enum cp_tree_index): Add CPTI_{ABI_TAG,ALIGNED,BEGIN,END,GET,TUPLE_{ELEMENT,SIZE}}_IDENTIFIER and CPTI_{GNU,TYPE,VALUE,FUN,CLOSURE}_IDENTIFIER. (abi_tag_identifier, aligned_identifier, begin_identifier, end_identifier, get__identifier, gnu_identifier, tuple_element_identifier, tuple_size_identifier, type_identifier, value_identifier, fun_identifier, closure_identifier): Define. * decl.c (initialize_predefined_identifiers): Initialize the above identifiers. (get_tuple_size): Use tuple_size_identifier instead of get_identifier ("tuple_size") and value_identifier instead of get_identifier ("value"). (get_tuple_element_type): Use tuple_element_identifier instead of get_identifier ("tuple_element") and type_identifier instead of get_identifier ("type"). (get_tuple_decomp_init): Use get__identifier instead of get_identifier ("get"). * lambda.c (maybe_add_lambda_conv_op): Use fun_identifier instead of get_identifier ("_FUN"). * parser.c (cp_parser_lambda_declarator_opt): Use closure_identifier instead of get_identifier ("__closure"). (cp_parser_std_attribute): Use gnu_identifier instead of get_identifier ("gnu"). (cp_parser_std_attribute_spec): Likewise. Use aligned_identifier instead of get_identifier ("aligned"). * class.c (check_abi_tags, inherit_targ_abi_tags): Use abi_tag_identifier instead of get_identifier ("abi_tag"). From-SVN: r262976
2018-07-18re PR c++/59480 (Missing error diagnostic: friend declaration specifying a ↵Paolo Carlini1-4/+6
default argument must be a definition) /cp 2018-07-18 Paolo Carlini <paolo.carlini@oracle.com> * class.c (note_name_declared_in_class): Prefer permerror + inform to a pair of permerrors; use DECL_SOURCE_LOCATION. /testsuite 2018-07-18 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/ext/uow-3.C: Adjust. * g++.dg/ext/uow-4.C: Likewise. * g++.dg/lookup/name-clash11.C: Likewise. * g++.dg/lookup/name-clash7.C: Likewise. * g++.dg/lookup/redecl1.C: Likewise. * g++.dg/warn/changes-meaning.C: Likewise. * g++.old-deja/g++.jason/scoping8.C: Likewise. * g++.old-deja/g++.law/nest1.C: Likewise. /cp 2019-07-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59480, DR 136 * decl.c (check_no_redeclaration_friend_default_args): New. (duplicate_decls): Use the latter; also check that a friend declaration specifying default arguments is a definition. /testsuite 2019-07-18 Paolo Carlini <paolo.carlini@oracle.com> PR c++/59480, DR 136 * g++.dg/other/friend8.C: New. * g++.dg/other/friend9.C: Likewise. * g++.dg/other/friend10.C: Likewise. * g++.dg/other/friend11.C: Likewise. * g++.dg/other/friend12.C: Likewise. * g++.dg/parse/defarg4.C: Compile with -fpermissive -w. * g++.dg/parse/defarg8.C: Likewise. From-SVN: r262851
2018-07-16class.c (resolve_address_of_overloaded_function): Don't emit an inform if ↵Paolo Carlini1-3/+4
the matching permerror returns false. /cp 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * class.c (resolve_address_of_overloaded_function): Don't emit an inform if the matching permerror returns false. * pt.c (check_specialization_namespace): Likewise. /testsuite 2018-07-16 Paolo Carlini <paolo.carlini@oracle.com> * g++.dg/template/spec40.C: New. * g++.dg/parse/ptrmem8.C: Likewise. From-SVN: r262740
2018-06-26PR c++/80290 - memory-hog with std::pair.Jason Merrill1-1/+1
* pt.c (fn_type_unification): Add convs parameter. (check_non_deducible_conversion): Remember conversion. (check_non_deducible_conversions): New. Do checks here. (type_unification_real): Not here. Remove flags parm. * call.c (add_function_candidate): Make convs a parameter. Don't recalculate the conversion if it's already set. (add_template_candidate_real): Allocate convs here. (good_conversion, conv_flags): New. When the std::pair constructors got more complex to handle, it aggravated a preexisting algorithmic problem in template overload resolution: As part of template argument deduction in a call, once we've deduced all the template arguments we can but before we substitute them to form an actual declaration, for any function parameters that don't involve template parameters we need to check that it's possible to convert the argument to the parameter type (wg21.link/cwg1391). As a result, we end up calculating the conversion twice: once here, and then again in add_function_candidate as part of normal overload resolution. Normally this isn't a big deal, but when the argument is a multiply-nested initializer list, doubling the conversion processing at each level leads to combinatorial explosion. The patch for trunk avoids the duplication by remembering the conversion we calculate at deduction time and then reusing it in overload resolution rather than calculating it again. From-SVN: r262172
2018-06-13PR c++/86094 - wrong code with defaulted move ctor.Jason Merrill1-0/+13
gcc/c-family/ * c-opts.c (c_common_post_options): Bump the current ABI version to 13. Set warn_abi_version and flag_abi_compat_version to the current version rather than 0. Fix defaulting flag_abi_compat_version from warn_abi_version. gcc/cp/ * class.c (classtype_has_non_deleted_move_ctor): New. * tree.c (maybe_warn_parm_abi, type_has_nontrivial_copy_init): Handle v12 breakage. From-SVN: r261562
2018-06-12Core issue 1331 - const mismatch with defaulted copy constructorMarek Polacek1-3/+3
Core issue 1331 - const mismatch with defaulted copy constructor * class.c (check_bases_and_members): When checking a defaulted function, mark it as deleted rather than giving an error. * g++.dg/cpp0x/defaulted15.C (struct F): Remove dg-error. * g++.dg/cpp0x/defaulted52.C: New test. * g++.dg/cpp0x/defaulted53.C: New test. * g++.dg/cpp0x/defaulted54.C: New test. * g++.dg/cpp0x/defaulted55.C: New test. * g++.dg/cpp0x/defaulted56.C: New test. * g++.dg/cpp0x/defaulted57.C: New test. * g++.dg/cpp0x/defaulted58.C: New test. * g++.dg/cpp0x/defaulted59.C: New test. * g++.dg/cpp0x/defaulted60.C: New test. From-SVN: r261526
2018-06-11PR c++/85792 -Wctor-dtor-privacy and inherited constructor.Jason Merrill1-2/+6
* class.c (maybe_warn_about_overly_private_class): Handle inherited constructors. From-SVN: r261459
2018-05-25PR c++/85815 - reference to member of enclosing template.Jason Merrill1-2/+2
* search.c (lookup_base): Use currently_open_class. (lookup_member): Use it regardless of -fconcepts. * parser.c (cp_parser_postfix_dot_deref_expression): Check it. From-SVN: r260782
2018-05-24cp-tree.h (INDIRECT_TYPE_P): New.Paolo Carlini1-5/+4
2018-05-24 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.h (INDIRECT_TYPE_P): New. * call.c (build_trivial_dtor_call, maybe_warn_class_memaccess, joust): Use it instead of POINTER_TYPE_P. * class.c (update_vtable_entry_for_fn, find_flexarrays, * fixed_type_or_null, resolves_to_fixed_type_p): Likewise. * constexpr.c (cxx_eval_binary_expression, cxx_fold_indirect_ref, * cxx_eval_increment_expression, potential_constant_expression_1): Likewise. * cp-gimplify.c (cp_gimplify_expr, cp_genericize_r): Likewise. * cp-objcp-common.c (cxx_get_alias_set): Likewise. * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call, cp_ubsan_maybe_instrument_downcast): Likewise. * cvt.c (cp_convert_to_pointer, ocp_convert, cp_get_fndecl_from_callee, maybe_warn_nodiscard, convert): Likewise. * cxx-pretty-print.c (cxx_pretty_printer::abstract_declarator, pp_cxx_offsetof_expression_1): Likewise. * decl.c (grokparms, static_fn_type): Likewise. * decl2.c (grokbitfield): Likewise. * error.c (dump_expr): Likewise. * except.c (initialize_handler_parm, check_noexcept_r): Likewise. * init.c (warn_placement_new_too_small): Likewise. * lambda.c (build_capture_proxy, add_capture): Likewise. * parser.c (cp_parser_omp_for_loop): Likewise. * pt.c (convert_nontype_argument, fn_type_unification, uses_deducible_template_parms, check_cv_quals_for_unify, dependent_type_p_r): Likewise. * search.c (check_final_overrider): Likewise. * semantics.c (handle_omp_array_sections, finish_omp_clauses, finish_omp_for): Likewise. * tree.c (cp_build_qualified_type_real): Likewise. * typeck.c (build_class_member_access_expr, finish_class_member_access_expr, build_x_indirect_ref, cp_build_indirect_ref_1, cp_build_binary_op, build_const_cast_1): Likewise. From-SVN: r260677
2018-05-22PR c++/81420 - not extending temporary lifetime.Jason Merrill1-1/+1
* call.c (extend_ref_init_temps_1): Handle ARRAY_REF. * class.c (build_base_path): Avoid redundant move of an rvalue. From-SVN: r260563
2018-05-20PR libstdc++/85843 - warning in logic_error copy constructor.Jason Merrill1-2/+2
* class.c (type_has_user_nondefault_constructor): Check for a user-provided ctor, not user-declared. From-SVN: r260432
2018-05-18PR c++/58407 - deprecated implicit copy ops.Jason Merrill1-0/+36
gcc/c-family/ * c.opt (Wdeprecated-copy): New flag. gcc/cp/ * call.c (build_over_call): Warn about deprecated trivial fns. * class.c (classtype_has_user_copy_or_dtor): New. (type_build_ctor_call): Check TREE_DEPRECATED. (type_build_dtor_call): Likewise. * decl2.c (cp_warn_deprecated_use): Move from tree.c. Add checks. Return bool. Handle -Wdeprecated-copy. (mark_used): Use it. * decl.c (grokdeclarator): Remove redundant checks. * typeck2.c (build_functional_cast): Likewise. * method.c (lazily_declare_fn): Mark deprecated copy ops. * init.c (build_aggr_init): Only set TREE_USED if there are side-effects. libitm/ * beginend.cc (save): Disable -Werror=deprecated-copy. From-SVN: r260381
2018-05-14Handle TYPE_HAS_LATE_RETURN_TYPE like ref-qualifier and eh spec.Jason Merrill1-21/+12
* tree.c (build_cp_fntype_variant): New. (build_ref_qualified_type, build_exception_variant) (strip_typedefs, cxx_copy_lang_qualifiers): Use it. (cxx_type_hash_eq, cp_check_qualified_type): Check TYPE_HAS_LATE_RETURN_TYPE. (cp_build_type_attribute_variant): Check cxx_type_hash_eq. (cp_build_qualified_type_real): No need to preserve C++ qualifiers. * class.c (build_clone): Use cxx_copy_lang_qualifiers. (adjust_clone_args): Likewise. * decl.c (grokfndecl): Add late_return_type_p parameter. Use build_cp_fntype_variant. (grokdeclarator): Pass late_return_type_p to grokfndecl. (check_function_type): Use cxx_copy_lang_qualifiers. (static_fn_type): Use cxx_copy_lang_qualifiers. * decl2.c (build_memfn_type, maybe_retrofit_in_chrg) (cp_reconstruct_complex_type, coerce_new_type, coerce_delete_type) (change_return_type): Use cxx_copy_lang_qualifiers. * mangle.c (write_type): Use cxx_copy_lang_qualifiers. * parser.c (cp_parser_lambda_declarator_opt): Represent an explicit return type on the declarator like a normal trailing return type. * pt.c (tsubst_function_type): Use build_cp_fntype_variant. (copy_default_args_to_explicit_spec): Use cxx_copy_lang_qualifiers. * typeck.c (merge_types): Use build_cp_fntype_variant. From-SVN: r260238
2018-05-14cp-tree.h (TYPE_REF_P): New.Paolo Carlini1-9/+9
2018-05-14 Paolo Carlini <paolo.carlini@oracle.com> * cp-tree.h (TYPE_REF_P): New. (TYPE_OBJ_P, TYPE_REF_OBJ_P, TYPE_REFFN_P): Update. * call.c (build_list_conv, build_aggr_conv, standard_conversion, direct_reference_binding, reference_binding, implicit_conversion, add_builtin_candidate, build_user_type_conversion_1, build_op_call_1, build_new_op_1, build_x_va_arg, conv_binds_ref_to_prvalue, build_over_call, perform_implicit_conversion_flags, extend_ref_init_temps, type_has_extended_temps): Use it. * class.c (one_inheriting_sig, check_field_decls, check_bases_and_members, find_flexarrays, finish_struct, fixed_type_or_null): Likewise. * constexpr.c (literal_type_p, cxx_bind_parameters_in_call, non_const_var_error, cxx_eval_constant_expression, potential_constant_expression_1): Likewise. * cp-gimplify.c (omp_var_to_track, omp_cxx_notice_variable, cp_genericize_r, cxx_omp_privatize_by_reference, cxx_omp_const_qual_no_mutable, cxx_omp_finish_clause, cp_fold_maybe_rvalue): Likewise. * cp-ubsan.c (cp_ubsan_maybe_instrument_downcast): Likewise. * cvt.c (build_up_reference, convert_to_reference, convert_from_reference, convert_to_void, noexcept_conv_p, fnptr_conv_p): Likewise. * decl.c (poplevel, check_for_uninitialized_const_var, check_initializer, initialize_local_var, cp_finish_decl, get_tuple_decomp_init, cp_finish_decomp, grokdeclarator, copy_fn_p, move_signature_fn_p, grok_op_properties, finish_function): Likewise. * decl2.c (grok_array_decl, cp_reconstruct_complex_type, decl_maybe_constant_var_p): Likewise. * error.c (dump_type_prefix, dump_expr): Likewise. * except.c (initialize_handler_parm, complete_ptr_ref_or_void_ptr_p, is_admissible_throw_operand_or_catch_parameter): Likewise. * expr.c (mark_use): Likewise. * init.c (build_zero_init_1, build_value_init_noctor, perform_member_init, diagnose_uninitialized_cst_or_ref_member_1, build_new, build_delete): Likewise. * lambda.c (build_lambda_object): Likewise. * mangle.c (write_expression, write_template_arg): Likewise. * method.c (forward_parm, do_build_copy_constructor, do_build_copy_assign, build_stub_object, constructible_expr, walk_field_subobs): Likewise. * parser.c (cp_parser_omp_for_loop_init, cp_parser_omp_declare_reduction_exprs, cp_parser_omp_declare_reduction): Likewise. * pt.c (convert_nontype_argument_function, convert_nontype_argument, convert_template_argument, tsubst_pack_expansion, tsubst_function_decl, tsubst_decl, tsubst, tsubst_copy_and_build, maybe_adjust_types_for_deduction, check_cv_quals_for_unify, unify, more_specialized_fn, invalid_nontype_parm_type_p, dependent_type_p_r, value_dependent_expression_p, build_deduction_guide): Likewise. * semantics.c (finish_handler_parms, finish_non_static_data_member, finish_compound_literal, omp_privatize_field, handle_omp_array_sections_1, handle_omp_array_sections, cp_check_omp_declare_reduction, finish_omp_reduction_clause, finish_omp_declare_simd_methods, cp_finish_omp_clause_depend_sink, finish_omp_clauses, finish_decltype_type, capture_decltype, finish_builtin_launder): Likewise. * tree.c (lvalue_kind, cp_build_reference_type, move, cp_build_qualified_type_real, stabilize_expr, stabilize_init): Likewise. * typeck.c (cxx_safe_arg_type_equiv_p, build_class_member_access_expr, cp_build_indirect_ref_1, convert_arguments, warn_for_null_address, cp_build_addr_expr_1, maybe_warn_about_useless_cast, build_static_cast_1, build_static_cast, build_reinterpret_cast_1, build_const_cast_1, cp_build_c_cast, cp_build_modify_expr, convert_for_initialization, maybe_warn_about_returning_address_of_local, check_return_expr, cp_type_quals, casts_away_constness, non_reference): Likewise. * typeck2.c (cxx_readonly_error, store_init_value, process_init_constructor_record, build_x_arrow, build_functional_cast, add_exception_specifier): Likewise. From-SVN: r260228
2018-05-10Core issue 2310 - conversion to base of incomplete type.Jason Merrill1-0/+9
* class.c (build_base_path): Check COMPLETE_TYPE_P for source type. From-SVN: r260127
2018-05-10* class.c (vbase_has_user_provided_move_assign): Use user_provided_p.Jason Merrill1-1/+1
From-SVN: r260123
2018-03-31[PR c++/85027] deal with baselink in save_expr in instantiate_typeAlexandre Oliva1-5/+5
We use SAVE_EXPRs in conditional expressions without the middle operand, to evaluate the first operand only once. When the conversion of the first operand fails, we may call instantiate_type get a better error message. We have code to peel off the SAVE_EXPR there, but then we may end up with a BASELINK, and we're past the code that deals with BASELINKs. Reorder the tests so that we expose the saved expr first, and then deal with BASELINKs. for gcc/cp/ChangeLog PR c++/85027 * class.c (instantiate_type): Peel off SAVE_EXPR before BASELINK. for gcc/testsuite/ChangeLog PR c++/85027 * g++.dg/pr85027.C: New. From-SVN: r258989
2018-03-27re PR c++/85068 (ICE with invalid covariant return type hierarchy)Jakub Jelinek1-8/+9
PR c++/85068 * class.c (update_vtable_entry_for_fn): Don't ICE if base_binfo is NULL. Assert if thunk_binfo is NULL then errorcount is non-zero. * g++.dg/inherit/covariant22.C: New test. From-SVN: r258873
2018-03-21Deprecate some C++ extensionsNathan Sidwell1-37/+19
https://gcc.gnu.org/ml/gcc-patches/2018-03/msg00995.html * doc/extend.texi (Deprecated Features): Update deprecared flags, mention anon-struct/union members and trailing attributes. cp/ * class.c (finish_struct_anon_r): Refactor, deprecate anything other than public non-static data members. * parser.c (cp_parser_init_declarator): Deprecate attributes after parenthesized initializer. testsuite/ * g++.dg/ext/anon-struct6.C: Adjust. * g++.dg/ext/deprecate-1.C: New. * g++.dg/ext/deprecate-2.C: New. * g++.dg/lookup/pr84602.C: Adjust. * g++.dg/lookup/pr84962.C: Adjust. * g++.old-deja/g++.other/anon4.C From-SVN: r258712
2018-02-27[PR c++/84426] ICE after conflicting member declNathan Sidwell1-8/+12
https://gcc.gnu.org/ml/gcc-patches/2018-02/msg01529.html PR c++/84426 * name-lookup.h (get_member_slot): Rename ... (find_member_slot): ... here. (add_member_slot): New. * name-lookup.c (member_vec_linear_search): No need to check for NULL slot. (get_member_slot): Rename ... (find_member_slot): ... here. Don't add slot for incomplete class. (add_member_slot): New. * class.c (add_method): Adjust get_member_slot rename. Bail out if push_class_level_binding fails. Create slot and grok properties once we're committed to insertion. PR c++/84426 * g++.dg/lookup/pr84426.C: New. From-SVN: r258042
2018-02-20re PR c++/84445 (ICE with __builtin_launder and virtual function)Jakub Jelinek1-1/+2
PR c++/84445 * class.c (fixed_type_or_null) <case CALL_EXPR>: Only test TREE_HAS_CONSTRUCTOR if instance is not an internal function call. * g++.dg/cpp1z/launder7.C: New test. From-SVN: r257840
2018-02-16PR c++/82764 - C++17 ICE with empty baseJason Merrill1-2/+8
* class.c (build_base_field_1): Set DECL_SIZE to zero for empty base. From-SVN: r257745
2018-02-08[C++ PATCH] initializer_list diagnosticNathan Sidwell1-4/+3
https://gcc.gnu.org/ml/gcc-patches/2018-02/msg00434.html * class.c (finish_struct): Fix std:initializer_list diagnostic formatting. * g++.dg/cpp0x/initlist93.C: Adjust diagnostic. From-SVN: r257496
2018-02-07Revert behavior to r251316.Martin Liska1-1/+1
2018-02-07 Martin Liska <mliska@suse.cz> PR c++/84059. * class.c (add_method): Append argument value. * cp-tree.h (maybe_version_functions): Add new argument. * decl.c (decls_match): Call it if a declaration does not have DECL_FUNCTION_VERSIONED. (maybe_version_functions): record argument is added. 2018-02-07 Martin Liska <mliska@suse.cz> PR c++/84059. * g++.dg/ext/mv26.C: New test. From-SVN: r257451
2018-02-05class.c: Remove unused global variables.Marek Polacek1-33/+0
* class.c: Remove unused global variables. (build_primary_vtable): Don't gather statistics. (print_class_statistics): Remove. * cp-tree.h (print_class_statistics): Remove. * tree.c (cxx_print_statistics): Don't call print_class_statistics. From-SVN: r257389
2018-02-02c-common.h (DECL_UNNAMED_BIT_FIELD): New.Paolo Carlini1-1/+1
/c-family 2018-02-02 Paolo Carlini <paolo.carlini@oracle.com> * c-common.h (DECL_UNNAMED_BIT_FIELD): New. /c 2018-02-02 Paolo Carlini <paolo.carlini@oracle.com> * c-typeck.c (really_start_incremental_init, push_init_level, set_nonincremental_init, output_init_element, process_init_element): Use DECL_UNNAMED_BIT_FIELD. /cp 2018-02-02 Paolo Carlini <paolo.carlini@oracle.com> * class.c (is_really_empty_class): Use DECL_UNNAMED_BIT_FIELD. * constexpr.c (cx_check_missing_mem_inits): Likewise. * decl.c (next_initializable_field, find_decomp_class_base, cp_finish_decomp): Likewise. * typeck2.c (process_init_constructor_record): Likewise. From-SVN: r257348
2018-01-15PR c++/83588 - struct with two flexible arrays causes an internal compiler errorMartin Sebor1-2/+5
gcc/cp/ChangeLog: PR c++/83588 * class.c (find_flexarrays): Make a record of multiple flexible array members. gcc/testsuite/ChangeLog: PR c++/83588 * g++.dg/ext/flexary28.C: New test. From-SVN: r256721
2018-01-03Update copyright years.Jakub Jelinek1-1/+1
From-SVN: r256169
2017-12-19read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order ↵Jakub Jelinek1-6/+8
conditions. * read-rtl.c (parse_reg_note_name): Replace Yoda conditions with typical order conditions. * sel-sched.c (extract_new_fences_from): Likewise. * config/visium/constraints.md (J, K, L): Likewise. * config/visium/predicates.md (const_shift_operand): Likewise. * config/visium/visium.c (visium_legitimize_address, visium_legitimize_reload_address): Likewise. * config/m68k/m68k.c (output_reg_adjust, emit_reg_adjust): Likewise. * config/arm/arm.c (arm_block_move_unaligned_straight): Likewise. * config/avr/constraints.md (Y01, Ym1, Y02, Ym2): Likewise. * config/avr/avr-log.c (avr_vdump, avr_log_set_avr_log, SET_DUMP_DETAIL): Likewise. * config/avr/predicates.md (const_8_16_24_operand): Likewise. * config/avr/avr.c (STR_PREFIX_P, avr_popcount_each_byte, avr_is_casesi_sequence, avr_casei_sequence_check_operands, avr_set_core_architecture, avr_set_current_function, avr_legitimize_reload_address, avr_asm_len, avr_print_operand, output_movqi, output_movsisf, avr_out_plus, avr_out_bitop, avr_out_fract, avr_adjust_insn_length, avr_encode_section_info, avr_2word_insn_p, output_reload_in_const, avr_has_nibble_0xf, avr_map_decompose, avr_fold_builtin): Likewise. * config/avr/driver-avr.c (avr_devicespecs_file): Likewise. * config/avr/gen-avr-mmcu-specs.c (str_prefix_p, print_mcu): Likewise. * config/i386/i386.c (ix86_parse_stringop_strategy_string): Likewise. * config/m32c/m32c-pragma.c (m32c_pragma_memregs): Likewise. * config/m32c/m32c.c (m32c_conditional_register_usage, m32c_address_cost): Likewise. * config/m32c/predicates.md (shiftcount_operand, longshiftcount_operand): Likewise. * config/iq2000/iq2000.c (iq2000_expand_prologue): Likewise. * config/nios2/nios2.c (nios2_handle_custom_fpu_insn_option, can_use_cdx_ldstw): Likewise. * config/nios2/nios2.h (CDX_REG_P): Likewise. * config/cr16/cr16.h (RETURN_ADDR_RTX, REGNO_MODE_OK_FOR_BASE_P): Likewise. * config/cr16/cr16.md (*mov<mode>_double): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/h8300/h8300.c (h8300_rtx_costs, get_shift_alg): Likewise. * config/vax/constraints.md (U06, U08, U16, CN6, S08, S16): Likewise. * config/vax/vax.c (adjacent_operands_p): Likewise. * config/ft32/constraints.md (L, b, KA): Likewise. * config/ft32/ft32.c (ft32_load_immediate, ft32_expand_prologue): Likewise. * cfgexpand.c (expand_stack_alignment): Likewise. * gcse.c (insert_expr_in_table): Likewise. * print-rtl.c (rtx_writer::print_rtx_operand_codes_E_and_V): Likewise. * cgraphunit.c (cgraph_node::expand): Likewise. * ira-build.c (setup_min_max_allocno_live_range_point): Likewise. * emit-rtl.c (add_insn): Likewise. * input.c (dump_location_info): Likewise. * passes.c (NEXT_PASS): Likewise. * read-rtl-function.c (parse_note_insn_name, function_reader::read_rtx_operand_r, function_reader::parse_mem_expr): Likewise. * sched-rgn.c (sched_rgn_init): Likewise. * diagnostic-show-locus.c (layout::show_ruler): Likewise. * combine.c (find_split_point, simplify_if_then_else, force_to_mode, if_then_else_cond, simplify_shift_const_1, simplify_comparison): Likewise. * explow.c (eliminate_constant_term): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * cfgrtl.c (print_rtl_with_bb): Likewise. * genhooks.c (emit_init_macros): Likewise. * poly-int.h (maybe_ne, maybe_le, maybe_lt): Likewise. * tree-data-ref.c (conflict_fn): Likewise. * selftest.c (assert_streq): Likewise. * expr.c (store_constructor_field, expand_expr_real_1): Likewise. * fold-const.c (fold_range_test, extract_muldiv_1, fold_truth_andor, fold_binary_loc, multiple_of_p): Likewise. * reload.c (push_reload, find_equiv_reg): Likewise. * et-forest.c (et_nca, et_below): Likewise. * dbxout.c (dbxout_symbol_location): Likewise. * reorg.c (relax_delay_slots): Likewise. * dojump.c (do_compare_rtx_and_jump): Likewise. * gengtype-parse.c (type): Likewise. * simplify-rtx.c (simplify_gen_ternary, simplify_gen_relational, simplify_const_relational_operation): Likewise. * reload1.c (do_output_reload): Likewise. * dumpfile.c (get_dump_file_info_by_switch): Likewise. * gengtype.c (type_for_name): Likewise. * gimple-ssa-sprintf.c (format_directive): Likewise. ada/ * gcc-interface/trans.c (Loop_Statement_to_gnu): Replace Yoda conditions with typical order conditions. * gcc-interface/misc.c (gnat_get_array_descr_info, default_pass_by_ref): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Likewise. * adaint.c (__gnat_tmp_name): Likewise. c-family/ * known-headers.cc (get_stdlib_header_for_name): Replace Yoda conditions with typical order conditions. c/ * c-typeck.c (comptypes_internal, function_types_compatible_p, perform_integral_promotions, digest_init): Replace Yoda conditions with typical order conditions. * c-decl.c (check_bitfield_type_and_width): Likewise. cp/ * name-lookup.c (get_std_name_hint): Replace Yoda conditions with typical order conditions. * class.c (check_bitfield_decl): Likewise. * pt.c (convert_template_argument): Likewise. * decl.c (duplicate_decls): Likewise. * typeck.c (commonparms): Likewise. fortran/ * scanner.c (preprocessor_line): Replace Yoda conditions with typical order conditions. * dependency.c (check_section_vs_section): Likewise. * trans-array.c (gfc_conv_expr_descriptor): Likewise. jit/ * jit-playback.c (get_type, playback::compile_to_file::copy_file, playback::context::acquire_mutex): Replace Yoda conditions with typical order conditions. * libgccjit.c (gcc_jit_context_new_struct_type, gcc_jit_struct_set_fields, gcc_jit_context_new_union_type, gcc_jit_context_new_function, gcc_jit_timer_pop): Likewise. * jit-builtins.c (matches_builtin): Likewise. * jit-recording.c (recording::compound_type::set_fields, recording::fields::write_reproducer, recording::rvalue::set_scope, recording::function::validate): Likewise. * jit-logging.c (logger::decref): Likewise. From-SVN: r255831
2017-11-22re PR c++/60336 (empty struct value is passed differently in C and C++)Marek Polacek1-0/+1
PR c++/60336 PR middle-end/67239 PR target/68355 * c-decl.c (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields. * class.c (layout_class_type): Set DECL_PADDING_P on padding. * decl.c (cxx_init_decl_processing): Set TRANSLATION_UNIT_WARN_EMPTY_P. (grokdeclarator): Set DECL_PADDING_P on unnamed bit-fields. * lto.c (compare_tree_sccs_1): Compare TYPE_EMPTY_P and DECL_PADDING_P. * calls.c (initialize_argument_information): Call warn_parameter_passing_abi target hook. (store_one_arg): Use 0 for empty record size. Don't push 0 size argument onto stack. (must_pass_in_stack_var_size_or_pad): Return false for empty types. * common.opt: Update -fabi-version description. * config/i386/i386.c (init_cumulative_args): Set cum->warn_empty. (ix86_gimplify_va_arg): Call arg_int_size_in_bytes instead of int_size_in_bytes. (ix86_is_empty_record): New function. (ix86_warn_parameter_passing_abi): New function. (TARGET_EMPTY_RECORD_P): Redefine. (TARGET_WARN_PARAMETER_PASSING_ABI): Redefine. * config/i386/i386.h (CUMULATIVE_ARGS): Add warn_empty. * doc/tm.texi: Regenerated. * doc/tm.texi.in (TARGET_EMPTY_RECORD_P, TARGET_WARN_PARAMETER_PASSING_ABI): Add. * dwarf2out.c (get_ultimate_context): Move to tree.c. * explow.c (hard_function_value): Call arg_int_size_in_bytes instead of int_size_in_bytes. * expr.c (copy_blkmode_to_reg): Likewise. * function.c (aggregate_value_p): Return 0 for empty types. (assign_parm_find_entry_rtl): Call warn_parameter_passing_abi target hook. (locate_and_pad_parm): Call arg size_in_bytes instead size_in_bytes. * lto-streamer-out.c (hash_tree): Hash TYPE_EMPTY_P and DECL_PADDING_P. * stor-layout.c (finalize_type_size): Set TYPE_EMPTY_P. * target.def (empty_record_p, warn_parameter_passing_abi): New target hooks. * targhooks.c (hook_void_CUMULATIVE_ARGS_tree): New hook. (std_gimplify_va_arg_expr): Skip empty records. Call arg_size_in_bytes instead size_in_bytes. * targhooks.h (hook_void_CUMULATIVE_ARGS_tree): Declare. * tree-core.h (tree_type_common): Add empty_flag. (tree_decl_common): Update comments. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Stream DECL_PADDING_P. (unpack_ts_type_common_value_fields): Stream TYPE_EMPTY_P. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Stream DECL_PADDING_P. (pack_ts_type_common_value_fields): Stream TYPE_EMPTY_P. * tree.c (default_is_empty_type): New function. (default_is_empty_record): New function. (arg_int_size_in_bytes): New function. (arg_size_in_bytes): New function. (get_ultimate_context): New function. * tree.h: Define TYPE_EMPTY_P, DECL_PADDING_P and TRANSLATION_UNIT_WARN_EMPTY_P. (default_is_empty_record, arg_int_size_in_bytes, arg_size_in_bytes, get_ultimate_context): Declare. * g++.dg/abi/empty12.C: New test. * g++.dg/abi/empty12.h: New test. * g++.dg/abi/empty12a.c: New test. * g++.dg/abi/empty13.C: New test. * g++.dg/abi/empty13.h: New test. * g++.dg/abi/empty13a.c: New test. * g++.dg/abi/empty14.C: New test. * g++.dg/abi/empty14.h: New test. * g++.dg/abi/empty14a.c: New test. * g++.dg/abi/empty15.C: New test. * g++.dg/abi/empty15.h: New test. * g++.dg/abi/empty15a.c: New test. * g++.dg/abi/empty16.C: New test. * g++.dg/abi/empty16.h: New test. * g++.dg/abi/empty16a.c: New test. * g++.dg/abi/empty17.C: New test. * g++.dg/abi/empty17.h: New test. * g++.dg/abi/empty17a.c: New test. * g++.dg/abi/empty18.C: New test. * g++.dg/abi/empty18.h: New test. * g++.dg/abi/empty18a.c: New test. * g++.dg/abi/empty19.C: New test. * g++.dg/abi/empty19.h: New test. * g++.dg/abi/empty19a.c: New test. * g++.dg/abi/empty20.C: New test. * g++.dg/abi/empty21.C: New test. * g++.dg/abi/empty22.C: New test. * g++.dg/abi/empty22.h: New test. * g++.dg/abi/empty22a.c: New test. * g++.dg/abi/empty23.C: New test. * g++.dg/abi/empty24.C: New test. * g++.dg/abi/empty25.C: New test. * g++.dg/abi/empty25.h: New test. * g++.dg/abi/empty25a.c: New test. * g++.dg/abi/empty26.C: New test. * g++.dg/abi/empty26.h: New test. * g++.dg/abi/empty26a.c: New test. * g++.dg/abi/empty27.C: New test. * g++.dg/abi/empty28.C: New test. * g++.dg/abi/pr60336-1.C: New test. * g++.dg/abi/pr60336-10.C: New test. * g++.dg/abi/pr60336-11.C: New test. * g++.dg/abi/pr60336-12.C: New test. * g++.dg/abi/pr60336-2.C: New test. * g++.dg/abi/pr60336-3.C: New test. * g++.dg/abi/pr60336-4.C: New test. * g++.dg/abi/pr60336-5.C: New test. * g++.dg/abi/pr60336-6.C: New test. * g++.dg/abi/pr60336-7.C: New test. * g++.dg/abi/pr60336-8.C: New test. * g++.dg/abi/pr60336-9.C: New test. * g++.dg/abi/pr68355.C: New test. * g++.dg/lto/pr60336_0.C: New test. Co-Authored-By: H.J. Lu <hongjiu.lu@intel.com> Co-Authored-By: Jason Merrill <jason@redhat.com> From-SVN: r255066
2017-11-21Add quotes for constexpr keyword.Martin Liska1-2/+2
2017-11-21 Martin Liska <mliska@suse.cz> * class.c (finalize_literal_type_property): Add quotes for constexpr keyword. (explain_non_literal_class): Likewise. * constexpr.c (ensure_literal_type_for_constexpr_object): Likewise. (is_valid_constexpr_fn): Likewise. (check_constexpr_ctor_body): Likewise. (register_constexpr_fundef): Likewise. (explain_invalid_constexpr_fn): Likewise. (cxx_eval_builtin_function_call): Likewise. (cxx_eval_call_expression): Likewise. (cxx_eval_loop_expr): Likewise. (potential_constant_expression_1): Likewise. * decl.c (check_previous_goto_1): Likewise. (check_goto): Likewise. (grokfndecl): Likewise. (grokdeclarator): Likewise. * error.c (maybe_print_constexpr_context): Likewise. * method.c (process_subob_fn): Likewise. (defaulted_late_check): Likewise. * parser.c (cp_parser_compound_statement): Likewise. 2017-11-21 Martin Liska <mliska@suse.cz> * g++.dg/cpp0x/constexpr-48089.C: Add quotes for constexpr keyword; add dg-message for 'in .constexpr. expansion of '. * g++.dg/cpp0x/constexpr-50060.C: Likewise. * g++.dg/cpp0x/constexpr-60049.C: Likewise. * g++.dg/cpp0x/constexpr-70323.C: Likewise. * g++.dg/cpp0x/constexpr-70323a.C: Likewise. * g++.dg/cpp0x/constexpr-cast.C: Likewise. * g++.dg/cpp0x/constexpr-diag3.C: Likewise. * g++.dg/cpp0x/constexpr-ex1.C: Likewise. * g++.dg/cpp0x/constexpr-generated1.C: Likewise. * g++.dg/cpp0x/constexpr-ice16.C: Likewise. * g++.dg/cpp0x/constexpr-ice5.C: Likewise. * g++.dg/cpp0x/constexpr-incomplete2.C: Likewise. * g++.dg/cpp0x/constexpr-neg1.C: Likewise. * g++.dg/cpp0x/constexpr-recursion.C: Likewise. * g++.dg/cpp0x/constexpr-shift1.C: Likewise. * g++.dg/cpp1y/constexpr-70265-1.C: Likewise. * g++.dg/cpp1y/constexpr-70265-2.C: Likewise. * g++.dg/cpp1y/constexpr-79655.C: Likewise. * g++.dg/cpp1y/constexpr-new.C: Likewise. * g++.dg/cpp1y/constexpr-return2.C: Likewise. * g++.dg/cpp1y/constexpr-shift1.C: Likewise. * g++.dg/cpp1y/constexpr-throw.C: Likewise. * g++.dg/cpp1z/constexpr-lambda6.C: Likewise. * g++.dg/ext/constexpr-vla1.C: Likewise. * g++.dg/ext/constexpr-vla2.C: Likewise. * g++.dg/ext/constexpr-vla3.C: Likewise. * g++.dg/cpp0x/static_assert10.C: Likewise. * g++.dg/cpp1y/pr63996.C: Likewise. * g++.dg/cpp1y/pr68180.C: Likewise. * g++.dg/cpp1y/pr77830.C: Likewise. * g++.dg/ubsan/pr63956.C: Likewise. From-SVN: r255025
2017-11-13Defer folding of *&.Jason Merrill1-9/+7
* typeck.c (cp_build_fold_indirect_ref): New. (cp_build_indirect_ref_1): Split out from cp_build_indirect_ref. Add 'fold' parameter. * cp-tree.h: Declare cp_build_fold_indirect_ref. * call.c, class.c, cp-ubsan.c, decl.c, except.c, init.c, lambda.c, parser.c, rtti.c, tree.c, typeck.c, typeck2.c: Use it. * parser.c (do_range_for_auto_deduction): Use RO_UNARY_STAR. (cp_convert_range_for): Likewise. * typeck2.c (build_x_arrow): Use RO_ARROW. From-SVN: r254712
2017-10-31diagnostics: get rid of *_at_rich_loc in favor of overloadingDavid Malcolm1-5/+8
Adding a fix-it hint currently involves changing e.g.: error_at (token->location, "unknown type name %qE; did you mean %qs?", token->value, hint); to: gcc_rich_location richloc (token->location); richloc.add_fixit_replace (hint); error_at_rich_loc (&richloc, "unknown type name %qE; did you mean %qs?", token->value, hint); to make the change from taking a location_t to a rich_location *. This patch renames the "*_at_rich_loc" diagnostic entrypoints to use the same function names for rich_location * as for location_t, via overloading, to simplify the above change to just changing from: error_at (token->location, "unknown type name %qE; did you mean %qs?", token->value, hint); to: gcc_rich_location richloc (token->location); richloc.add_fixit_replace (hint); error_at (&richloc, "unknown type name %qE; did you mean %qs?", token->value, hint); thus saving space (and typing) and usually avoiding the need to reindent the "error_at" invocation. With this change, 0 is no longer acceptable as a location_t to these entrypoints, as e.g.: ../../src/gcc/auto-profile.c:855:37: error: call of overloaded 'inform(int, const char [18])' is ambiguous inform (0, "Not expected TAG."); ^ In file included from ../../src/gcc/auto-profile.c:35:0: ../../src/gcc/diagnostic-core.h:88:13: note: candidate: 'void inform(location_t, const char*, ...)' extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); ^~~~~~ ../../src/gcc/diagnostic-core.h:89:13: note: candidate: 'void inform(rich_location*, const char*, ...)' extern void inform (rich_location *, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3); ^~~~~~ Such locations now need to be spelled out as UNKNOWN_LOCATION, rather than 0. I considered making the API take a rich_location & rather than a rich_location *, but doing so would mean replacing diagnostic_set_info and diagnostic_set_info_translated with a constructor for diagnostic_info, which was a more invasive change. Maybe in the future. gcc/ChangeLog: * auto-profile.c (autofdo_source_profile::read): Use UNKNOWN_LOCATION rather than 0. * diagnostic-core.h (warning_at_rich_loc): Rename to... (warning_at): ...this overload. (warning_at_rich_loc_n): Rename to... (warning_n): ...this overload. (error_at_rich_loc): Rename to... (error_at): ...this overload. (pedwarn_at_rich_loc): Rename to... (pedwarn): ...this overload. (permerror_at_rich_loc): Rename to... (permerror): ...this overload. (inform_at_rich_loc): Rename to... (inform): ...this overload. * diagnostic.c: (diagnostic_n_impl): Delete location_t-based decl. (diagnostic_n_impl_richloc): Rename to... (diagnostic_n_impl): ...this rich_location *-based decl. (inform_at_rich_loc): Rename to... (inform): ...this, and add an assertion. (inform_n): Update for removal of location_t-based diagnostic_n_impl. (warning_at_rich_loc): Rename to... (warning_at): ...this, and add an assertion. (warning_at_rich_loc_n): Rename to... (warning_n): ...this, and add an assertion. (warning_n): Update location_t-based implementation for removal of location_t-based diagnostic_n_impl. (pedwarn_at_rich_loc): Rename to... (pedwarn): ...this, and add an assertion. (permerror_at_rich_loc): Rename to... (permerror): ...this, and add an assertion. (error_n): Update for removal of location_t-based diagnostic_n_impl. (error_at_rich_loc): Rename to... (error_at): ...this, and add an assertion. * gcc.c (do_spec_1): Use UNKNOWN_LOCATION rather than 0. (driver::do_spec_on_infiles): Likewise. * substring-locations.c (format_warning_va): Update for renaming of inform_at_rich_loc. gcc/c-family/ChangeLog: * c-common.c (binary_op_error): Update for renaming of error_at_rich_loc. (c_parse_error): Likewise. * c-warn.c (warn_logical_not_parentheses): Likewise for renaming of inform_at_rich_loc. (warn_for_restrict): Likewise for renaming of warning_at_rich_loc_n. gcc/c/ChangeLog: * c-decl.c (implicit_decl_warning): Update for renaming of pedwarn_at_rich_loc and warning_at_rich_loc. (implicitly_declare): Likewise for renaming of inform_at_rich_loc. (undeclared_variable): Likewise for renaming of error_at_rich_loc. * c-parser.c (c_parser_declaration_or_fndef): Likewise. (c_parser_struct_or_union_specifier): Likewise for renaming of pedwarn_at_rich_loc. (c_parser_parameter_declaration): Likewise for renaming of error_at_rich_loc. * c-typeck.c (build_component_ref): Likewise. (build_unary_op): Likewise for renaming of inform_at_rich_loc. (pop_init_level): Likewise for renaming of warning_at_rich_loc. (set_init_label): Likewise for renaming of error_at_rich_loc. gcc/cp/ChangeLog: * class.c (explain_non_literal_class): Use UNKNOWN_LOCATION rather than 0. * name-lookup.c (suggest_alternatives_for): Update for renaming of inform_at_rich_loc. (maybe_suggest_missing_header): Likewise. (suggest_alternative_in_explicit_scope): Likewise. * parser.c (cp_parser_diagnose_invalid_type_name): Likewise for renaming of error_at_rich_loc. (cp_parser_string_literal): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_cast_expression): Likewise for renaming of warning_at_rich_loc. (cp_parser_decl_specifier_seq): Likewise for renaming of error_at_rich_loc and warning_at_rich_loc. (cp_parser_elaborated_type_specifier): Likewise for renaming of pedwarn_at_rich_loc. (cp_parser_cv_qualifier_seq_opt): Likewise for renaming of error_at_rich_loc. (cp_parser_virt_specifier_seq_opt): Likewise. (cp_parser_class_specifier_1): Likewise. (cp_parser_class_head): Likewise. (cp_parser_member_declaration): Likewise for renaming of pedwarn_at_rich_loc, warning_at_rich_loc, and error_at_rich_loc. (cp_parser_enclosed_template_argument_list): Likewise for renaming of error_at_rich_loc. (set_and_check_decl_spec_loc): Likewise. * pt.c (listify): Likewise. * rtti.c (typeid_ok_p): Likewise. * semantics.c (process_outer_var_ref): Use UNKNOWN_LOCATION rather than 0. * typeck.c (access_failure_info::maybe_suggest_accessor): Update for renaming of inform_at_rich_loc. (finish_class_member_access_expr): Likewise for renaming of error_at_rich_loc. gcc/objc/ChangeLog: * objc-gnu-runtime-abi-01.c (objc_gnu_runtime_abi_01_init): Use UNKNOWN_LOCATION rather than 0. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_plugin_show_trees.c (show_tree): Update for renaming of error_at_rich_loc and inform_at_rich_loc. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (test_show_locus): Likewise for renaming of warning_at_rich_loc. libcpp/ChangeLog: * directives.c (_cpp_handle_directive): Update for renaming of cpp_error_at_richloc to cpp_error_at. * errors.c (cpp_diagnostic_at_richloc): Rename to... (cpp_diagnostic_at): ...this, dropping the location_t-based implementation. (cpp_diagnostic): Update for removal of location_t-based cpp_diagnostic_at. (cpp_error_at): Likewise. (cpp_error_at_richloc): Rename to... (cpp_error_at): ...this, and update for renaming of cpp_diagnostic_at_richloc. * include/cpplib.h (cpp_error_at_richloc): Rename to... (cpp_error_at): ...this. From-SVN: r254280
2017-10-31[C++ PATCH] overloaded operator fns [2/N]Nathan Sidwell1-1/+1
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02326.html gcc/cp/ * cp-tree.h (ovl_op_identifier): New. (assign_op_identifier, call_op_identifier): Adjust. (cp_operator_id, cp_assignment_operator_ide): Delete. (SET_OVERLOADED_OPERATOR_CODE): Delete. (OVL_OP_INFO): New. * call.c (op_error): Use OVL_OP_INFO. (build_conditional_expr_1): Use ovl_op_identifier. (build_new_op_1): Use OVL_OP_INFO & ovl_op_identifier. (build_op_delete_call): Likewise. * class.c (type_requires_array_cookie): Use ovl_op_identifier. * decl.c (duplicate_decls): Directly copy operator code. (builtin_function_1): Do not set operator code. (build_library_fn): Directly set operator code. (push_cp_library_fn): Use ovl_op_identifier. (grok_op_properties): Directly set operator code. * decl2.c (maybe_warn_sized_delete): Use ovl_op_identifier. * error.c (dump_expr): Use OVL_OP_INFO. (op_to_string): Add assop arg. Use OVL_OP_INFO. (assop_to_string): Delete. (args_to_string): Adjust. * init.c (build_new_1): Use ovl_op_identifier. * mangle.c (write_unqualified_name): Use OVL_OP_INFO. (write_expression): Likewise. * method.c (synthesized_method_walk): Use ovl_op_identifier. (implicitly_declare_fn): Use assign_op_identifier. Directly set operator code. * name-lookup.c (get_class_binding): Use assign_op_identifier. * parser.c (cp_parser_operator): Use ovl_op_identifier. (cp_parser_omp_clause_reduction): Likewise. * semantics.c (omp_reduction_id): Likewise. * typeck.c (cxx_sizeof_or_alignof_type): Use OVL_OP_INFO. libcc1/ * libcp1plugin.cc (plugin_build_decl): Use ovl_op_identifier. Directly set operator code. (plugin_build_dependent_expr): Use ovl_op_identifier. From-SVN: r254267
2017-10-31[C++ PATCH] overloaded operator fns [1/N]Nathan Sidwell1-3/+3
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg02315.html * cp-tree.h (assign_op_identifier, call_op_identifier): Define. (LAMBDA_FUNCTION_P): Use DECL_OVERLOADED_OPERATOR_IS. (DECL_OVERLOADED_OPERATOR_P): Just retuurn true/false. (DECL_OVERLOADED_OPERATOR_CODE, DECL_OVERLOADED_OPERATOR_IS): Define. * call.c (add_function_candidate): Use DECL_OVERLOADED_OPERATOR_IS. (build_op_call_1): Use call_op_identifier & DECL_OVERLOADED_OPERATOR_IS. (build_over_call): Likewise. (has_trivial_copy_assign_p): Use assign_op_identifier. (build_special_member_call): Likewise. * class.c (dfs_declare_virt_assop_and_dtor): Likewise. (vbase_has_user_provided_move_assign, classtype_has_move_assign_or_move_ctor_p): Likewise. * decl.c (duplicate_decls): Use DECL_OVERLOADED_OPERATOR_CODE. (grok_special_member_properties): Use assign_op_identifier. (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS. * decl2.c (mark_used): Use DECL_CONV_FN_P. * dump.c (dump_access): Delete prototype. (dump_op): Delete. (cp_dump_tree): Don't call it. * lambda.c (lambda_function): Use call_op_identifier. (maybe_add_lambda_conv_op): Not an overloaded operator. Remove unneeded braces. * mangle.c (write_unqualified_name): Use DECL_OVERLOADED_OPERTOR_CODE. * method.c (do_build_copy_assign): Use assign_op_identifier. (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS. (get_copy_assign): Use assign_op_identifier. (synthesized_method_walk): Likewise. (defaultable_fn_check): Use DECL_OVERLOADED_OPERATOR_IS. * parser.c (cp_parser_lambda_declarator_opt): Use call_op_identifier. * semanitics.c (classtype_has_nothrow_assign_or_copy_p): Use assign_op_identifier. * tree.c (special_function_p): Use DECL_OVERLOADED_OPERATOR_IS. * typeck.c (check_return_expr): Use DECL_OVERLOADED_OPERATOR_CODE. (check_return_expr): Use assign_op_identifier. From-SVN: r254263
2017-10-20[C++ PATCH] AS_BASETYPENathan Sidwell1-17/+12
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01376.html * class.c (layout_class_type): Cleanup as-base creation, determine mode here. (finish_struct_1): ... not here. From-SVN: r253954
2017-10-05[C++ PATCH] Kill IDENTIFIER_GLOBAL_VALUENathan Sidwell1-2/+2
https://gcc.gnu.org/ml/gcc-patches/2017-10/msg00239.html Kill IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE * cp-tree.h (IDENTIFIER_GLOBAL_VALUE, SET_IDENTIFIER_GLOBAL_VALUE): Delete. * name-lookup.h (set_global_binding): Remove NAME parm. (get_global_binding): New inline fn. * name-lookup.c (set_global_binding): Remove NAME parm. Adjust. (identifier_global_value): Move to ... * cp-objcp-common.c (identifier_global_value): ... here. * class.c (build_ctor_vtbl_group, build_vtbl_initializer): Adjust. * decl.c (record_builtin_type, expand_static_init, grokdeclarator): Adjust. * decl2.c (get_guard, get_local_tls_init_fn, get_tls_init_fn, get_tls_wrapper_fn, maybe_warn_sized_delete): Adjust. * except.c (declare_library_fn, build_throw): Adjust. * init.c (throw_bad_array_length): Adjust. * rtti.c (throw_bad_cast, throw_bad_typeid, get_tinfo_decl): Adjust. From-SVN: r253444
2017-09-29P0683R1 - default member initializers for bit-fieldsJakub Jelinek1-5/+5
P0683R1 - default member initializers for bit-fields cp/ * cp-tree.h (grokbitfield): Add INIT parameter. * parser.c (cp_parser_constant_expression): Add STRICT_P argument, if true, parse a conditional-expression rather than assignment-expression. (cp_parser_member_declaration): For C++11 and later pass true as STRICT_P to cp_parser_constant_expression. Parse C++2A bitfield NSDMIs. Adjust grokbitfield caller. Handle DECL_INITIAL also for DECL_C_BIT_FIELDs. (cp_parser_objc_class_ivars): Adjust grokbitfield caller. * class.c (check_field_decl): Recurse even for DECL_C_BIT_FIELDs. (check_field_decls): Call check_field_decl even for DECL_C_BIT_FIELDs. * decl2.c (grokbitfield): Add INIT parameter, pass it to cp_finish_decl. * pt.c (tsubst_decl): Handle DECL_INITIAL for all FIELD_DECLs, not just non-bitfields. testsuite/ * g++.dg/ext/bitfield6.C: New test. * g++.dg/cpp2a/bitfield1.C: New test. * g++.dg/cpp2a/bitfield2.C: New test. * g++.dg/cpp2a/bitfield3.C: New test. From-SVN: r253302
2017-09-29c-attribs.c (handle_packed_attribute): Test DECL_C_BIT_FIELD rather than ↵Jakub Jelinek1-7/+8
DECL_INITIAL. c-family/ * c-attribs.c (handle_packed_attribute): Test DECL_C_BIT_FIELD rather than DECL_INITIAL. (common_handle_aligned_attribute): Likewise. c/ * c-decl.c (grokfield): Use SET_DECL_C_BIT_FIELD here if width is non-NULL. (finish_struct): Test DECL_C_BIT_FIELD instead of DECL_INITIAL, don't SET_DECL_C_BIT_FIELD here. cp/ * class.c (check_bitfield_decl): Retrieve and clear width from DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL. (check_field_decls): Test DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL. (remove_zero_width_bit_fields): Adjust comment. * decl2.c (grokbitfield): Stash width into DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL. * pt.c (tsubst_decl): For DECL_C_BIT_FIELD, tsubst_expr DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL for width. objc/ * objc-act.c (check_ivars, gen_declaration): For OBJCPLUS look at DECL_BIT_FIELD_REPRESENTATIVE rather than DECL_INITIAL. From-SVN: r253301
2017-09-15invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and ↵Jakub Jelinek1-4/+4
gnu++1z as deprecated. * doc/invoke.texi: Document -std=c++17 and -std=gnu++17 and document c++1z and gnu++1z as deprecated. Change other references to -std=c++1z to -std=c++17 and -std=gnu++1z to -std=gnu++17. Change -Wc++1z-compat to -Wc++17-compat. * doc/cpp.texi: Document -std=c++17 defines __cplusplus 201703L. * dwarf2out.c (highest_c_language): Handle C++17. (gen_compile_unit_die): Likewise. c-family/ * c.opt (Wc++1z-compat): Change from option to undocumented alias. (Wc++17-compat): Change from undocumented alias to option. (Wnoexcept-type): Enable by Wc++17-compat instead of Wc++1z-compat, change C++1z to C++17 in description. (std=c++1z, std=gnu++1z): Change from option to undocumented deprecated alias. (std=c++17, std=gnu++17): Change from undocumented alias to option. Adjust description. * c-common.h (enum cxx_dialect): Rename cxx1z to cxx17. * c-opts.c (set_std_cxx1z): Rename to ... (set_std_cxx17): ... this. (c_common_handle_option): Rename OPT_std_c__1z to OPT_std_c__17 and OPT_std_gnu__1z to OPT_std_gnu__17. Adjust set_std_cxx1z caller. (c_common_post_options): Use cxx17 instead of cxx1z. Adjust comments. cp/ * decl.c (redeclaration_error_message): Use cxx17 instead of cxx1z, adjust diagnostics refering to C++1z or -std=gnu++1z or -std=c++1z to C++17 or -std=gnu++17 or -std=c++17. Adjust comments. (cxx_init_decl_processing, next_initializable_field, is_direct_enum_init, check_initializer, cp_finish_decl, mark_inline_variable, grokdeclarator, grokparms, xref_basetypes, finish_function): Likewise. * cp-tree.h (DECL_INLINE_VAR_P): Likewise. * pt.c (mark_template_parm, convert_nontype_argument, instantiate_class_template_1, type_unification_real, unify, get_partial_spec_bindings, dependent_type_p_r): Likewise. * typeck.c (cp_build_unary_op): Likewise. * constexpr.c (var_in_maybe_constexpr_fn): Likewise. * call.c (build_user_type_conversion_1, build_over_call, build_special_member_call): Likewise. * lambda.c (begin_lambda_type): Likewise. * typeck2.c (process_init_constructor_record): Likewise. * class.c (build_base_field, finalize_literal_type_property, explain_non_literal_class): Likewise. * parser.c (cp_parser_diagnose_invalid_type_name, cp_parser_primary_expression, cp_parser_lambda_introducer, cp_parser_lambda_declarator_opt, cp_parser_selection_statement, cp_convert_range_for, cp_parser_perform_range_for_lookup, cp_parser_decomposition_declaration, cp_parser_linkage_specification, cp_parser_static_assert, cp_parser_simple_type_specifier, cp_parser_namespace_definition, cp_parser_using_declaration, cp_parser_init_declarator, cp_parser_type_parameter_key, cp_parser_exception_specification_opt, cp_parser_std_attribute_spec, cp_parser_constructor_declarator_p): Likewise. * mangle.c (struct globals): Rename need_cxx1z_warning to need_cxx17_warning. (write_exception_spec, start_mangling, mangle_decl): Likewise. * Make-lang.in (check-c++1z): Rename to check-c++17, depend on it. (check-c++17): New goal. Use 17 instead of 1z. (check-c++-all): Use 17 instead of 1z. testsuite/ * lib/g++-dg.exp (g++-dg-runtest): Use 17 instead of 1z. * lib/target-supports.exp (check_effective_target_c++14): Use check_effective_target_c++17 instead of check_effective_target_c++1z. (check_effective_target_c++14_down): Likewise. (check_effective_target_c++1z_only): Rename to ... (check_effective_target_c++17_only): ... this. (check_effective_target_c++1z): Rename to ... (check_effective_target_c++17): ... this. * g++.dg/debug/dwarf2/inline-var-1.C: Use -std=c++17 or -std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z and c++17_only instead of c++1z_only. Adjust expected diagnostics and comments refering to 1z to 17. * g++.dg/debug/dwarf2/inline-var-2.C: Likewise. * g++.dg/template/partial5.C: Likewise. * g++.dg/template/nontype8.C: Likewise. * g++.dg/cpp1z/noexcept-type5.C: Likewise. * g++.dg/cpp1z/nontype3a.C: Likewise. * g++.dg/cpp1z/constexpr-lambda4.C: Likewise. * g++.dg/cpp1z/noexcept-type16.C: Likewise. * g++.dg/cpp1z/class-deduction32.C: Likewise. * g++.dg/cpp1z/pr78771.C: Likewise. * g++.dg/cpp1z/elide1.C: Likewise. * g++.dg/cpp1z/fold3.C: Likewise. * g++.dg/cpp1z/class-deduction2.C: Likewise. * g++.dg/cpp1z/noexcept-type12.C: Likewise. * g++.dg/cpp1z/inline-var2.C: Likewise. * g++.dg/cpp1z/eval-order2.C: Likewise. * g++.dg/cpp1z/decomp21.C: Likewise. * g++.dg/cpp1z/constexpr-lambda11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda9.C: Likewise. * g++.dg/cpp1z/utf8-neg.C: Likewise. * g++.dg/cpp1z/class-deduction41.C: Likewise. * g++.dg/cpp1z/class-deduction23.C: Likewise. * g++.dg/cpp1z/nodiscard3.C: Likewise. * g++.dg/cpp1z/static_assert-nomsg.C: Likewise. * g++.dg/cpp1z/noexcept-type9.C: Likewise. * g++.dg/cpp1z/class-deduction21.C: Likewise. * g++.dg/cpp1z/range-for1.C: Likewise. * g++.dg/cpp1z/init-statement4.C: Likewise. * g++.dg/cpp1z/udlit-utf8char.C: Likewise. * g++.dg/cpp1z/decomp30.C: Likewise. * g++.dg/cpp1z/class-deduction39.C: Likewise. * g++.dg/cpp1z/register2.C: Likewise. * g++.dg/cpp1z/decomp9.C: Likewise. * g++.dg/cpp1z/regress1.C: Likewise. * g++.dg/cpp1z/direct-enum-init1.C: Likewise. * g++.dg/cpp1z/class-deduction30.C: Likewise. * g++.dg/cpp1z/abbrev2.C: Likewise. * g++.dg/cpp1z/nontype-auto6.C: Likewise. * g++.dg/cpp1z/regress2.C: Likewise. * g++.dg/cpp1z/decomp16.C: Likewise. * g++.dg/cpp1z/bool-increment1.C: Likewise. * g++.dg/cpp1z/aligned-new1.C: Likewise. * g++.dg/cpp1z/decomp3.C: Likewise. * g++.dg/cpp1z/register1.C: Likewise. * g++.dg/cpp1z/namespace-attribs.C: Likewise. * g++.dg/cpp1z/class-deduction1.C: Likewise. * g++.dg/cpp1z/decomp10.C: Likewise. * g++.dg/cpp1z/constexpr-if11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda10.C: Likewise. * g++.dg/cpp1z/decomp27.C: Likewise. * g++.dg/cpp1z/noexcept-type2.C: Likewise. * g++.dg/cpp1z/constexpr-lambda6.C: Likewise. * g++.dg/cpp1z/class-deduction9.C: Likewise. * g++.dg/cpp1z/attributes-enum-1.C: Likewise. * g++.dg/cpp1z/decomp11.C: Likewise. * g++.dg/cpp1z/aligned-new3.C: Likewise. * g++.dg/cpp1z/utf8-2.C: Likewise. * g++.dg/cpp1z/lambda-this3.C: Likewise. * g++.dg/cpp1z/decomp-constexpr1.C: Likewise. * g++.dg/cpp1z/byte1.C: Likewise. * g++.dg/cpp1z/nontype-auto9.C: Likewise. * g++.dg/cpp1z/aggr-base4.C: Likewise. * g++.dg/cpp1z/constexpr-lambda1.C: Likewise. * g++.dg/cpp1z/nontype-auto3.C: Likewise. * g++.dg/cpp1z/utf8-2a.C: Likewise. * g++.dg/cpp1z/constexpr-lambda7.C: Likewise. * g++.dg/cpp1z/aggr-base6.C: Likewise. * g++.dg/cpp1z/cplusplus.C: Likewise. * g++.dg/cpp1z/class-deduction20.C: Likewise. * g++.dg/cpp1z/aggr-base2.C: Likewise. * g++.dg/cpp1z/class-deduction6.C: Likewise. * g++.dg/cpp1z/noexcept-type3.C: Likewise. * g++.dg/cpp1z/class-deduction31.C: Likewise. * g++.dg/cpp1z/class-deduction25.C: Likewise. * g++.dg/cpp1z/class-deduction18.C: Likewise. * g++.dg/cpp1z/fold9.C: Likewise. * g++.dg/cpp1z/noexcept-type8.C: Likewise. * g++.dg/cpp1z/abbrev1.C: Likewise. * g++.dg/cpp1z/constexpr-if10.C: Likewise. * g++.dg/cpp1z/utf8.C: Likewise. * g++.dg/cpp1z/noexcept-type7.C: Likewise. * g++.dg/cpp1z/aggr-base3.C: Likewise. * g++.dg/cpp1z/constexpr-lambda8.C: Likewise. * g++.dg/cpp1z/init-statement2.C: Likewise. * g++.dg/cpp1z/nontype-auto4.C: Likewise. * g++.dg/cpp1z/constexpr-if12.C: Likewise. * g++.dg/cpp1z/class-deduction40.C: Likewise. * g++.dg/cpp1z/nontype3.C: Likewise. * g++.dg/cpp1z/class-deduction14.C: Likewise. * g++.dg/cpp1z/fold7.C: Likewise. * g++.dg/cpp1z/nontype2.C: Likewise. * g++.dg/cpp1z/class-deduction15.C: Likewise. * g++.dg/cpp1z/nested-namespace-def1.C: Likewise. * g++.dg/cpp1z/class-deduction13.C: Likewise. * g++.dg/cpp1z/aligned-new7.C: Likewise. * g++.dg/cpp1z/noexcept-type1.C: Likewise. * g++.dg/cpp1z/nontype1.C: Likewise. * g++.dg/cpp1z/init-statement5.C: Likewise. * g++.dg/cpp1z/nontype-auto2.C: Likewise. * g++.dg/cpp1z/decomp17.C: Likewise. * g++.dg/cpp1z/fold4.C: Likewise. * g++.dg/cpp1z/constexpr-lambda2.C: Likewise. * g++.dg/cpp1z/fold7a.C: Likewise. * g++.dg/cpp1z/nontype-auto5.C: Likewise. * g++.dg/cpp1z/init-statement7.C: Likewise. * g++.dg/cpp1z/aggr-base5.C: Likewise. * g++.dg/cpp1z/constexpr-lambda5.C: Likewise. * g++.dg/cpp1z/pr79143.C: Likewise. * g++.dg/cpp1z/class-deduction38.C: Likewise. * g++.dg/cpp1z/nontype-auto8.C: Likewise. * g++.dg/cpp1z/class-deduction12.C: Likewise. * g++.dg/cpp1z/decomp20.C: Likewise. * g++.dg/cpp1z/class-deduction22.C: Likewise. * g++.dg/cpp1z/class-deduction29.C: Likewise. * g++.dg/cpp1z/class-deduction8.C: Likewise. * g++.dg/cpp1z/class-deduction43.C: Likewise. * g++.dg/cpp1z/feat-cxx1z.C: Likewise. * g++.dg/cpp1z/fold8.C: Likewise. * g++.dg/cpp1z/init-statement3.C: Likewise. * g++.dg/cpp1z/nontype-auto10.C: Likewise. * g++.dg/cpp1z/class-deduction36.C: Likewise. * g++.dg/cpp1z/noexcept-type17.C: Likewise. * g++.dg/cpp1z/fallthrough1.C: Likewise. * g++.dg/cpp1z/fold1.C: Likewise. * g++.dg/cpp1z/class-deduction26.C: Likewise. * g++.dg/cpp1z/fold-ice1.C: Likewise. * g++.dg/cpp1z/fold5.C: Likewise. * g++.dg/cpp1z/class-deduction34.C: Likewise. * g++.dg/cpp1z/noexcept-type6.C: Likewise. * g++.dg/cpp1z/class-deduction7.C: Likewise. * g++.dg/cpp1z/class-deduction16.C: Likewise. * g++.dg/cpp1z/class-deduction10.C: Likewise. * g++.dg/cpp1z/eval-order3.C: Likewise. * g++.dg/cpp1z/constexpr-lambda13.C: Likewise. * g++.dg/cpp1z/aggr-base2a.C: Likewise. * g++.dg/cpp1z/nontype-auto1.C: Likewise. * g++.dg/cpp1z/constexpr-lambda3.C: Likewise. * g++.dg/cpp1z/nontype-auto7.C: Likewise. * g++.dg/cpp1z/decomp15.C: Likewise. * g++.dg/cpp1z/noexcept-type4.C: Likewise. * g++.dg/cpp1z/fold-mangle.C: Likewise. * g++.dg/cpp1z/class-deduction35.C: Likewise. * g++.dg/cpp1z/decomp4.C: Likewise. * g++.dg/cpp1z/class-deduction42.C: Likewise. * g++.dg/cpp1z/init-statement8.C: Likewise. * g++.dg/cpp1z/inline-var1a.C: Likewise. * g++.dg/cpp1z/init-statement6.C: Likewise. * g++.dg/cpp1z/class-deduction17.C: Likewise. * g++.dg/cpp1z/class-deduction28.C: Likewise. * g++.dg/cpp1z/class-deduction27.C: Likewise. * g++.dg/cpp1z/decomp-bitfield1.C: Likewise. * g++.dg/cpp1z/attributes-enum-1a.C: Likewise. * g++.dg/cpp1z/class-deduction11.C: Likewise. * g++.dg/cpp1z/constexpr-lambda12.C: Likewise. * g++.dg/cpp1z/init-statement9.C: Likewise. * g++.dg/cpp1z/class-deduction19.C: Likewise. * g++.dg/cpp1z/class-deduction5.C: Likewise. * g++.dg/cpp1z/fold2.C: Likewise. * g++.dg/cpp1z/class-deduction33.C: Likewise. * g++.dg/cpp1z/class-deduction24.C: Likewise. * g++.dg/cpp1z/aggr-base1.C: Likewise. * g++.dg/cpp1z/fold6.C: Likewise. * g++.dg/cpp1z/decomp12.C: Likewise. * g++.dg/cpp1z/class-deduction4.C: Likewise. * g++.dg/cpp1z/inline-var1.C: Likewise. * g++.dg/cpp1z/aligned-new2.C: Likewise. * g++.dg/cpp1z/class-deduction3.C: Likewise. * g++.dg/other/error3.C: Likewise. * g++.dg/init/new25.C: Likewise. * g++.dg/init/new13.C: Likewise. * g++.dg/tls/diag-2.C: Likewise. * g++.dg/tls/diag-4.C: Likewise. * g++.dg/opt/noreturn-1.C: Likewise. * g++.dg/eh/async-unwind2.C: Likewise. * g++.dg/eh/spec9.C: Likewise. * g++.dg/eh/spec7.C: Likewise. * g++.dg/eh/template1.C: Likewise. * g++.dg/eh/cond4.C: Likewise. * g++.dg/eh/pr41819.C: Likewise. * g++.dg/eh/delete1.C: Likewise. * g++.dg/eh/spec3.C: Likewise. * g++.dg/eh/forced4.C: Likewise. * g++.dg/eh/spec2.C: Likewise. * g++.dg/eh/shadow1.C: Likewise. * g++.dg/eh/pr38662.C: Likewise. * g++.dg/eh/ehopt1.C: Likewise. * g++.dg/eh/spec8.C: Likewise. * g++.dg/eh/init-temp2.C: Likewise. * g++.dg/rtti/crash3.C: Likewise. * g++.dg/warn/Wreturn-type-3.C: Likewise. * g++.dg/warn/register-parm-1.C: Likewise. * g++.dg/warn/register-var-2.C: Likewise. * g++.dg/gcov/gcov-7.C: Likewise. * g++.dg/tree-ssa/pr45605.C: Likewise. * g++.dg/cpp/pr23827_cxx98_neg.C: Likewise. * g++.dg/lookup/exception1.C: Likewise. * g++.dg/ubsan/pr79589.C: Likewise. * g++.dg/tm/pr47340.C: Likewise. * g++.dg/tm/pr46567.C: Likewise. * g++.dg/expr/bitfield5.C: Likewise. * g++.dg/expr/bool1.C: Likewise. * g++.dg/expr/lval3.C: Likewise. * g++.dg/expr/lval4.C: Likewise. * g++.dg/expr/bitfield4.C: Likewise. * g++.dg/expr/bitfield6.C: Likewise. * g++.dg/expr/bool3.C: Likewise. * g++.dg/ext/has_nothrow_constructor.C: Likewise. * g++.dg/ext/has_nothrow_copy-7.C: Likewise. * g++.dg/ext/has_nothrow_copy-1.C: Likewise. * g++.dg/ext/has_nothrow_copy-2.C: Likewise. * g++.dg/ext/has_nothrow_copy-4.C: Likewise. * g++.dg/ext/has_nothrow_copy-5.C: Likewise. * g++.dg/ext/has_nothrow_copy-6.C: Likewise. * g++.dg/ext/has_nothrow_assign.C: Likewise. * g++.dg/parse/register1.C: Likewise. * g++.dg/parse/error15.C: Likewise. * g++.dg/parse/linkage2.C: Likewise. * g++.dg/concepts/intro2.C: Likewise. * g++.dg/concepts/class.C: Likewise. * g++.dg/concepts/traits1.C: Likewise. * g++.dg/concepts/req5.C: Likewise. * g++.dg/concepts/var-concept5.C: Likewise. * g++.dg/concepts/fn-concept2.C: Likewise. * g++.dg/concepts/traits2.C: Likewise. * g++.dg/concepts/placeholder2.C: Likewise. * g++.dg/concepts/class6.C: Likewise. * g++.dg/concepts/memtmpl1.C: Likewise. * g++.dg/concepts/friend2.C: Likewise. * g++.dg/concepts/template-parm3.C: Likewise. * g++.dg/concepts/template-parm10.C: Likewise. * g++.dg/concepts/explicit-spec1.C: Likewise. * g++.dg/concepts/explicit-spec3.C: Likewise. * g++.dg/concepts/var-templ2.C: Likewise. * g++.dg/concepts/intro5.C: Likewise. * g++.dg/concepts/deduction-constraint1.C: Likewise. * g++.dg/concepts/iconv1.C: Likewise. * g++.dg/concepts/constrained-parm.C: Likewise. * g++.dg/concepts/template-template-parm1.C: Likewise. * g++.dg/concepts/var-concept3.C: Likewise. * g++.dg/concepts/class3.C: Likewise. * g++.dg/concepts/memfun2.C: Likewise. * g++.dg/concepts/req1.C: Likewise. * g++.dg/concepts/disjunction1.C: Likewise. * g++.dg/concepts/req17.C: Likewise. * g++.dg/concepts/pr65848.C: Likewise. * g++.dg/concepts/placeholder4.C: Likewise. * g++.dg/concepts/decl-diagnose.C: Likewise. * g++.dg/concepts/intro7.C: Likewise. * g++.dg/concepts/pr68683.C: Likewise. * g++.dg/concepts/partial-spec4.C: Likewise. * g++.dg/concepts/template-parm5.C: Likewise. * g++.dg/concepts/explicit-inst1.C: Likewise. * g++.dg/concepts/class-deduction1.C: Likewise. * g++.dg/concepts/class1.C: Likewise. * g++.dg/concepts/req15.C: Likewise. * g++.dg/concepts/memfun.C: Likewise. * g++.dg/concepts/pr68434.C: Likewise. * g++.dg/concepts/inherit-ctor4.C: Likewise. * g++.dg/concepts/partial-spec6.C: Likewise. * g++.dg/concepts/var-templ1.C: Likewise. * g++.dg/concepts/template-parm8.C: Likewise. * g++.dg/concepts/explicit-inst3.C: Likewise. * g++.dg/concepts/class4.C: Likewise. * g++.dg/concepts/req6.C: Likewise. * g++.dg/concepts/fn8.C: Likewise. * g++.dg/concepts/class5.C: Likewise. * g++.dg/concepts/placeholder5.C: Likewise. * g++.dg/concepts/req16.C: Likewise. * g++.dg/concepts/req10.C: Likewise. * g++.dg/concepts/var-concept2.C: Likewise. * g++.dg/concepts/auto3.C: Likewise. * g++.dg/concepts/generic-fn-err.C: Likewise. * g++.dg/concepts/pr65552.C: Likewise. * g++.dg/concepts/partial-concept-id2.C: Likewise. * g++.dg/concepts/fn1.C: Likewise. * g++.dg/concepts/partial-spec.C: Likewise. * g++.dg/concepts/template-parm12.C: Likewise. * g++.dg/concepts/diagnostic1.C: Likewise. * g++.dg/concepts/intro1.C: Likewise. * g++.dg/concepts/explicit-inst4.C: Likewise. * g++.dg/concepts/req18.C: Likewise. * g++.dg/concepts/explicit-spec5.C: Likewise. * g++.dg/concepts/var-concept6.C: Likewise. * g++.dg/concepts/fn9.C: Likewise. * g++.dg/concepts/req2.C: Likewise. * g++.dg/concepts/template-parm7.C: Likewise. * g++.dg/concepts/req14.C: Likewise. * g++.dg/concepts/template-parm6.C: Likewise. * g++.dg/concepts/variadic4.C: Likewise. * g++.dg/concepts/fn6.C: Likewise. * g++.dg/concepts/req-neg1.C: Likewise. * g++.dg/concepts/alias3.C: Likewise. * g++.dg/concepts/expression2.C: Likewise. * g++.dg/concepts/partial-spec3.C: Likewise. * g++.dg/concepts/expression3.C: Likewise. * g++.dg/concepts/memfun-err.C: Likewise. * g++.dg/concepts/pr66091.C: Likewise. * g++.dg/concepts/explicit-spec2.C: Likewise. * g++.dg/concepts/equiv.C: Likewise. * g++.dg/concepts/friend1.C: Likewise. * g++.dg/concepts/fn4.C: Likewise. * g++.dg/concepts/var-templ3.C: Likewise. * g++.dg/concepts/explicit-inst2.C: Likewise. * g++.dg/concepts/alias2.C: Likewise. * g++.dg/concepts/regress/alias-decl-42.C: Likewise. * g++.dg/concepts/placeholder6.C: Likewise. * g++.dg/concepts/fn10.C: Likewise. * g++.dg/concepts/req3.C: Likewise. * g++.dg/concepts/variadic2.C: Likewise. * g++.dg/concepts/pr65636.C: Likewise. * g++.dg/concepts/intro6.C: Likewise. * g++.dg/concepts/class2.C: Likewise. * g++.dg/concepts/fn2.C: Likewise. * g++.dg/concepts/req20.C: Likewise. * g++.dg/concepts/req8.C: Likewise. * g++.dg/concepts/placeholder1.C: Likewise. * g++.dg/concepts/pr65854.C: Likewise. * g++.dg/concepts/member-concept.C: Likewise. * g++.dg/concepts/template-parm2.C: Likewise. * g++.dg/concepts/variadic1.C: Likewise. * g++.dg/concepts/fn7.C: Likewise. * g++.dg/concepts/intro4.C: Likewise. * g++.dg/concepts/req13.C: Likewise. * g++.dg/concepts/inherit-ctor3.C: Likewise. * g++.dg/concepts/explicit-spec6.C: Likewise. * g++.dg/concepts/auto1.C: Likewise. * g++.dg/concepts/alias1.C: Likewise. * g++.dg/concepts/fn-concept1.C: Likewise. * g++.dg/concepts/template-parm11.C: Likewise. * g++.dg/concepts/explicit-spec4.C: Likewise. * g++.dg/concepts/partial-concept-id1.C: Likewise. * g++.dg/concepts/req9.C: Likewise. * g++.dg/concepts/req4.C: Likewise. * g++.dg/concepts/pr65681.C: Likewise. * g++.dg/concepts/req7.C: Likewise. * g++.dg/concepts/req12.C: Likewise. * g++.dg/concepts/fn5.C: Likewise. * g++.dg/concepts/alias4.C: Likewise. * g++.dg/concepts/generic-fn.C: Likewise. * g++.dg/concepts/feature-macro.C: Likewise. * g++.dg/concepts/req19.C: Likewise. * g++.dg/concepts/placeholder3.C: Likewise. * g++.dg/concepts/intro3.C: Likewise. * g++.dg/concepts/partial-spec5.C: Likewise. * g++.dg/concepts/template-parm4.C: Likewise. * g++.dg/concepts/dr1430.C: Likewise. * g++.dg/concepts/pr65634.C: Likewise. * g++.dg/concepts/var-concept4.C: Likewise. * g++.dg/concepts/pr67249.C: Likewise. * g++.dg/concepts/expression.C: Likewise. * g++.dg/concepts/pr65575.C: Likewise. * g++.dg/concepts/partial-spec2.C: Likewise. * g++.dg/concepts/template-parm9.C: Likewise. * g++.dg/concepts/inherit-ctor1.C: Likewise. * g++.dg/concepts/equiv2.C: Likewise. * g++.dg/concepts/req11.C: Likewise. * g++.dg/concepts/template-parm1.C: Likewise. * g++.dg/concepts/inherit-ctor2.C: Likewise. * g++.dg/concepts/var-concept1.C: Likewise. * g++.dg/concepts/fn3.C: Likewise. * g++.dg/torture/pr46364.C: Likewise. * g++.dg/torture/stackalign/eh-alloca-1.C: Likewise. * g++.dg/torture/stackalign/eh-fastcall-1.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-1.C: Likewise. * g++.dg/torture/stackalign/eh-vararg-2.C: Likewise. * g++.dg/torture/stackalign/eh-global-1.C: Likewise. * g++.dg/torture/stackalign/eh-thiscall-1.C: Likewise. * g++.dg/torture/stackalign/eh-inline-2.C: Likewise. * g++.dg/torture/stackalign/eh-inline-1.C: Likewise. * g++.dg/torture/pr52918-1.C: Likewise. * g++.dg/torture/pr49394.C: Likewise. * g++.dg/torture/pr57190.C: Likewise. * g++.dg/cpp0x/static_assert8.C: Likewise. * g++.dg/cpp0x/noexcept19.C: Likewise. * g++.dg/cpp0x/variadic-throw.C: Likewise. * g++.dg/cpp0x/variadic73.C: Likewise. * g++.dg/cpp0x/noexcept02.C: Likewise. * g++.dg/cpp0x/defaulted23.C: Likewise. * g++.dg/cpp0x/noexcept08.C: Likewise. * g++.dg/cpp0x/auto9.C: Likewise. * g++.dg/cpp0x/lambda/lambda-eh2.C: Likewise. * g++.dg/cpp0x/error5.C: Likewise. * c-c++-common/gomp/atomic-12.c: Likewise. * c-c++-common/gomp/atomic-13.c: Likewise. * c-c++-common/gomp/atomic-14.c: Likewise. * c-c++-common/Wvarargs-2.c: Likewise. * c-c++-common/Wvarargs.c: Likewise. * c-c++-common/vector-subscript-2.c: Likewise. * g++.old-deja/g++.robertl/eb123.C: Likewise. * g++.old-deja/g++.eh/tmpl3.C: Likewise. * g++.old-deja/g++.eh/cleanup2.C: Likewise. * g++.old-deja/g++.eh/badalloc1.C: Likewise. * g++.old-deja/g++.eh/throw2.C: Likewise. * g++.old-deja/g++.eh/throw1.C: Likewise. * g++.old-deja/g++.eh/tmpl1.C: Likewise. * g++.old-deja/g++.other/new7.C: Likewise. * g++.old-deja/g++.other/crash30.C: Likewise. * g++.old-deja/g++.other/regstack.C: Likewise. * g++.old-deja/g++.other/crash28.C: Likewise. * g++.old-deja/g++.jason/bool5.C: Likewise. * g++.old-deja/g++.mike/p10416.C: Likewise. * g++.old-deja/g++.mike/eh25.C: Likewise. * g++.old-deja/g++.mike/eh55.C: Likewise. libcpp/ * include/cpplib.h (enum c_lang): Rename CLK_GNUCXX1Z to CLK_GNUCXX17 and CLK_CXX1Z to CLK_CXX17. * init.c (lang_defaults, cpp_init_builtins): Likewise. * expr.c (cpp_classify_number): Use C++17 instead of C++1z in diagnostics. libstdc++-v3/ * testsuite/libstdc++-prettyprinters/cxx17.cc: Use -std=c++17 or -std=gnu++17 instead of -std=c++1z or -std=gnu++1z. Use c++17 instead of c++1z and c++17_only instead of c++1z_only. Adjust expected diagnostics and comments refering to 1z to 17. * testsuite/30_threads/lock_guard/cons/deduction.cc: Likewise. * testsuite/30_threads/scoped_lock/cons/deduction.cc: Likewise. * testsuite/30_threads/scoped_lock/cons/1.cc: Likewise. * testsuite/30_threads/scoped_lock/requirements/typedefs.cc: Likewise. * testsuite/30_threads/scoped_lock/requirements/explicit_instantiation.cc: Likewise. * testsuite/30_threads/unique_lock/cons/deduction.cc: Likewise. * testsuite/18_support/launder/1.cc (test02): Likewise. * testsuite/18_support/launder/requirements_neg.cc: Likewise. * testsuite/18_support/launder/requirements.cc: Likewise. * testsuite/18_support/byte/requirements.cc: Likewise. * testsuite/18_support/byte/ops.cc: Likewise. * testsuite/18_support/byte/global_neg.cc: Likewise. * testsuite/18_support/uncaught_exceptions/uncaught_exceptions.cc: Likewise. * testsuite/27_io/types/4.cc: Likewise. * testsuite/25_algorithms/sample/81221.cc: Likewise. * testsuite/25_algorithms/sample/1.cc: Likewise. * testsuite/25_algorithms/sample/2.cc: Likewise. * testsuite/25_algorithms/search/searcher.cc: Likewise. * testsuite/28_regex/basic_regex/ctors/deduction.cc: Likewise. * testsuite/experimental/filesystem/path/construct/string_view.cc: Likewise. * testsuite/24_iterators/range_access_cpp17.cc: Likewise. * testsuite/24_iterators/container_access.cc: Likewise. * testsuite/ext/pb_ds/regression/hash_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/hash_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/list_update_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/priority_queue_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_set_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/tree_map_rand.cc: Likewise. * testsuite/ext/pb_ds/regression/trie_map_rand.cc: Likewise. * testsuite/20_util/shared_ptr/casts/reinterpret.cc: Likewise. * testsuite/20_util/shared_ptr/cons/deduction.cc: Likewise. * testsuite/20_util/shared_ptr/cons/array.cc: Likewise. * testsuite/20_util/shared_ptr/observers/array.cc (struct A): Likewise. * testsuite/20_util/pair/cons/deduction.cc: Likewise. * testsuite/20_util/variant/deduction.cc: Likewise. * testsuite/20_util/tuple/78939.cc: Likewise. * testsuite/20_util/tuple/cons/deduction.cc: Likewise. * testsuite/20_util/void_t/1.cc: Likewise. * testsuite/20_util/duration/arithmetic/constexpr_c++17.cc: Likewise. * testsuite/20_util/unique_ptr/cons/deduction_neg.cc: Likewise. * testsuite/20_util/addressof/requirements/constexpr.cc: Likewise. * testsuite/20_util/weak_ptr/cons/deduction.cc: Likewise. * testsuite/20_util/has_unique_object_representations/requirements/typedefs.cc: Likewise. * testsuite/20_util/has_unique_object_representations/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/has_unique_object_representations/value.cc: Likewise. * testsuite/20_util/time_point/arithmetic/constexpr.cc: Likewise. * testsuite/20_util/function_objects/invoke/59768.cc: Likewise. * testsuite/20_util/function_objects/mem_fn/80478.cc: Likewise. * testsuite/20_util/function/cons/deduction.cc: Likewise. * testsuite/20_util/specialized_algorithms/memory_management_tools/destroy_neg.cc: Likewise. * testsuite/20_util/is_aggregate/requirements/typedefs.cc: Likewise. * testsuite/20_util/is_aggregate/requirements/explicit_instantiation.cc: Likewise. * testsuite/20_util/is_aggregate/value.cc: Likewise. * testsuite/26_numerics/lcm/1.cc: Likewise. * testsuite/26_numerics/lcm/lcm_neg.cc: Likewise. * testsuite/26_numerics/gcd/1.cc: Likewise. * testsuite/26_numerics/gcd/gcd_neg.cc: Likewise. * testsuite/26_numerics/valarray/deduction.cc: Likewise. * testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc: Likewise. * testsuite/26_numerics/headers/cmath/hypot.cc: Likewise. * testsuite/23_containers/queue/members/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/array/cons/deduction.cc: Likewise. * testsuite/23_containers/array/cons/deduction_neg.cc: Likewise. * testsuite/23_containers/deque/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/deque/cons/deduction.cc: Likewise. * testsuite/23_containers/stack/members/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/list/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/list/cons/deduction.cc: Likewise. * testsuite/23_containers/forward_list/modifiers/emplace_cxx17_return.cc: Likewise. * testsuite/23_containers/forward_list/cons/deduction.cc: Likewise. * testsuite/23_containers/unordered_set/allocator/ext_ptr.cc: Likewise. * testsuite/23_containers/vector/modifiers/emplace/cxx17_return.cc: Likewise. * testsuite/23_containers/vector/cons/deduction.cc: Likewise. * testsuite/23_containers/vector/bool/emplace_cxx17_return.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/9.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/deduction.cc: Likewise. * testsuite/21_strings/basic_string/cons/char/79162.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/9.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/deduction.cc: Likewise. * testsuite/21_strings/basic_string/cons/wchar_t/79162.cc: Likewise. * testsuite/21_strings/basic_string_view/modifiers/swap/char/1.cc: Likewise. * testsuite/21_strings/basic_string_view/modifiers/swap/wchar_t/1.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/char/2.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc: Likewise. * testsuite/21_strings/basic_string_view/operations/compare/wchar_t/2.cc: Likewise. * testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc: Likewise. From-SVN: r252826
2017-09-13Rename CLASSTYPE_METHOD_VEC to CLASSTYPE_MEMBER_VEC.Nathan Sidwell1-5/+5
* cp-tree.h (struct lang_type): Rename methods to members. (CLASSTYPE_METHOD_VEC): Rename to ... (CLASSTYPE_MEMBER_VEC): ... this. * name-lookup.h (get_method_slot): Rename to ... (get_member_slot): ... this. (resort_type_method_vec): Rename to ... (resort_type_member_vec): ... this. * class.c (add_method, warn_hidden): Adjust. * search.c (dfs_locate_field_accessor_pre): Adjust. * name-lookup.c (method_vec_binary_search): Rename to ... (member_vec_binary_search): ... this and adjust. (method_vec_linear_search): Rename to ... (member_vec_linear_search): ... this and adjust. (fields_linear_search, get_class_binding_direct): Adjust. (get_method_slot): Rename to ... (get_member_slot): ... this and adjust. (method_name_slot): Rename to ... (member_name_slot): ... this and adjust. (resort_type_method_vec): Rename to ... (resort_type_member_vec): ... this and adjust. (method_vec_append_class_fields): Rename to ... (member_vec_append_class_fields): ... this and adjust. (method_vec_append_enum_values): Rename to ... (member_vec_append_enum_values): ... this and adjust. (method_vec_dedup): Rename to ... (member_vec_dedup): ... this and adjust. (set_class_bindings, insert_late_enum_def_bindings): Adjust. From-SVN: r252078
2017-09-06class.c (warn_hidden): Don't barf on non-functions.Nathan Sidwell1-51/+52
* class.c (warn_hidden): Don't barf on non-functions. * decl2.c (check_classfn): Likewise. Check template match earlier. From-SVN: r251795