]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Merge trunk r260623.
authorNathan Sidwell <nathan@gcc.gnu.org>
Fri, 6 Jul 2018 11:40:20 +0000 (11:40 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 6 Jul 2018 11:40:20 +0000 (11:40 +0000)
From-SVN: r262473

1  2 
ChangeLog.name-lookup
gcc/c-family/c-ada-spec.c
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/pt.c
libcc1/libcp1plugin.cc

index f66522aa69562536deb00266b935241581bbc72e,0000000000000000000000000000000000000000..94044c4f27f7735c8c48deb791f887bbca606ad1
mode 100644,000000..100644
--- /dev/null
@@@ -1,1117 -1,0 +1,1121 @@@
++2018-07-06  Nathan Sidwell  <nathan@acm.org>
++
++      Merge trunk r260623.
++
 +2017-11-03  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r254369.
 +
 +2017-11-01  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r254314.
 +
 +      Merge trunk r254279.
 +
 +2017-10-31  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r254263.
 +
 +      Merge trunk r254243.
 +
 +2017-10-30  Nathan Sidwell  <nathan@acm.org>
 +
 +      Operator code compaction part 12.
 +      gcc/cp/
 +      * cp-tree.h (CPTI_CONV_OP_IDENTIFIER): Restore.
 +      (conv_op_identifier): Revert.
 +      * decl.c (initialize_predefined_identifiers): Restore.
 +      (grok_op_properties): Detect conversion operators.
 +      * decl2.c (mark_used): Dectect lambda conversion properly.
 +      * lambda.c (maybe_add_lambda_conv_op): Not an overloaded fn.
 +      * lex.c (init_operators): No need to deal with TYPE_EXPR.
 +
 +      Merge trunk r254231.
 +
 +      Operator code compaction part 11.
 +      gcc/cp/
 +      * cp-tree.h (lang_decl_fn): Move spare bits to end.
 +      (ovl_op_flags): Adjust names.
 +      * decl.c (grokdeclarator): Use OVL_OP_FLAG_ALLOC.
 +      (grok_op_properties): Adjust ellipsis and arg scanning.
 +      * lex.c (init_operators): Adjust assert.
 +      * operators.def: Adjust new & delete flags.
 +      * pt.c (push_template_decl_real): Use OVL_OP_FLAG_ALLOC.
 +      * typeck.c (check_return_expr): Likewise.
 +
 +      Operator code compaction part 10.
 +      gcc/cp/
 +      * cp-tree.h (ovl_op_flags): Adjust.
 +      (ovl_op_alternate): Declare.
 +      * decl.c (grokdeclarator): Adjust NEW/DEL selection.
 +      (grok_op_properties): Move warnings to end.  Don't multiply check
 +      specific tree codes.
 +      * lex.c (ovl_op_alternate): Define.
 +      (init_operators): Initialize it.
 +      * operators.def: Adjust new/delete.
 +      * pt.c (push_template_decl_real): Likewise.
 +      * typeck.c (check_return_expr): Likewise.
 +      gcc/testsuite/
 +      * g++.dg/other/operator2.C: Adjust diagnostic.
 +      * g++.old-deja/g++.jason/operator.C: Likewise.
 +
 +2017-10-27  Nathan Sidwell  <nathan@acm.org>
 +
 +      Operator code compaction part 9.
 +      gcc/cp/
 +      * cp-tree.h (lang_decl_fn): Replace operator_code with smaller
 +      ovl_op_code field.
 +      (DECL_OVERLOADED_OPERATOR_CODE, SET_OVERLOADED_OPERATOR_CODE): Delete.
 +      (DECL_OVERLOADED_OPERATOR_CODE_RAW): New.
 +      (DECL_OVERLOADED_OPERATOR_IS): Adjust.
 +      * decl.c (duplicate_decls): Open code operator copying.
 +      (builtin_function_1): Don't set operator code.
 +      (build_library_fn): Adjust operator code setting.
 +      (grok_op_properties): Likewise.
 +      * lambda.c (maybe_add_lambda_conv_op): Likewise.
 +      * method.c (implicitly_declare_fn): Likewise.
 +      * mangle.c (write_unqualified_name): Adjust operator name
 +      accessor.
 +      libcc1/
 +      * libcp1plugin.cc (plugin_build_decl): Adjust.
 +
 +      Operator code compaction part 8.
 +      gcc/cp/
 +      * cp-tree.h (CPTI_CONV_OP_IDENTIFIER): Delete.
 +      (conv_op_identifier): Map into ovl_op_info array.
 +      (enum cp_identifier_kind): Swap cik_conv_op &
 +      cik_reserved_for_udlit.
 +      (IDENTIFIER_CONV_OP_P): Adjust.
 +      * decl.c (initialize_predefined_identifiers): Drop conv_op.
 +      (grok_op_properties): Use IDENTIFIER_OVL_OP_INFO for all ops.
 +      * lex.c (get_identifier_kind_name): Adjust.
 +      (init_operators): Special case TYPE_EXPR.
 +      * operators.def: Add TYPE_EXPR. Casts are mangling only.
 +
 +      Operator code compaction part 7.
 +      gcc/cp/
 +      * cp-tree.h (cp_identifier_kind): Swap cik_assign_op &
 +      cik_reserved_for_udlit.
 +      (IDENTIFIER_OVL_OP_P, IDENTIFIER_ASSIGN_OP_P,
 +      IDENTIFIER_CONV_OP_P, IDENTIFIER_OVL_OP_INFO): Update.
 +      * decl.c (ambi_op_p, unary_op_p): Delete.
 +      (grok_op_properties): Reimplement operator lookup.
 +      * lex.c (get_identifier_kind_name): Adjust.
 +      * mangle.c (write_unqualified_id): Use IDENTIFIER_OVL_OP_INFO.
 +      * operators.def (COMPONENT_REF): Is unary.
 +
 +      Operator code compaction part 6.
 +      gcc/cp/
 +      (enum cp_operator_kind): Delete cik_newdel_op.
 +      (IDENTIFIER_NEWDEL_OP_P): Delete.
 +      (IDENTIFIER_OVL_OP_P): New.
 +      (enum ovl_op_flags): New.
 +      (struct ovl_op_info_t): Delete kind, reorder.
 +      (IDENTIFIER_OVL_OP_INFO, IDENTIFIER_OVL_OP_FLAGS): New.
 +      * decl.c (grokdeclarator): Use IDENTIFIER_OVL_OP_FLAGS.
 +      * lex.c (ovl_op_info): Adjust initialization.
 +      (get_identifier_kind_name): Lose new-del-op.
 +      (set_operator_ident): Return identifier.  Don't set kind.
 +      (init_operators): Set kind here.  Set IDENTIFIER_CP_INDEX.
 +      * mangle.c (write_unqualified_id): Pick first operator.
 +      * operators.def: Adjust.
 +      * pt.c (push_template_decl_real): Use IDENTIFIER_OVL_OP_FLAGS.
 +      * typeck.c (check_return_expr): Likewise.
 +
 +      Operator code compaction part 5.
 +      gcc/cp/
 +      * cp-tree.h (ovl_op_code): Rename from overloaded_operator_code.
 +      (ovl_op_info_t, ovl_op_info, ovl_op_mapping): Rename from
 +      ooc_$FOO.
 +      (operator_name_info_t, operator_name_info,
 +      assignment_operator_name_info): Delete.
 +      * *.c: Update all uses.
 +
 +      Merge trunk r254141.
 +
 +      Operator code compaction part 4.
 +      gcc/cp/
 +      * cp-tree.h (cp_assignment_operator_id): Delete.
 +      (assign_op_identifier, call_op_identifier): New.
 +      * call.c (build_op_call_1): Use call_op_identifier.
 +      (has_trivial_copy_assign_p): Use assign_op_identifier.
 +      (build_special_member_call): Likewise.
 +      * class.c (dfs_declare_virt_assop_and_dtor,
 +      classtype_has_move_assign_or_move_ctor_p): Likewise.
 +      * decl.c (grok_special_member_properties): Likewise.
 +      * lambda.c (lambda_function): Use call_op_identifier.
 +      * method.c (do_build_copy_assign): Use assign_op_identifier.
 +      (get_copy_assign, synthesized_method_walk,
 +      implicitly_declare_fn): Likewise.
 +      * parser.c (cp_parser_lambda_declarator_opt): Use call_op_identifier.
 +      * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
 +      assign_op_identifier.
 +      * typeck.c (check_return_expr): Likewise.
 +
 +2017-10-26  Nathan Sidwell  <nathan@acm.org>
 +
 +      Operator code compaction part 3.
 +      gcc/cp
 +      * cp-tree.h (cp_operator_id): Delete.
 +      (ovl_op_identifier): Define.
 +      (OOC_INFO): Define.
 +      * call.c (build_op_call_1): Use ovl_op_identifier.
 +      (op_error): Use OOC_INFO.
 +      (build_conditional_expr_1): Use ovl_op_identifier.
 +      (build_new_op_1): Likewise.
 +      (build_op_delete_call): Likewise.
 +      * class.c (type_requires_array_cookie): Likewise.
 +      * decl.c (push_cp_library_fn): Likewise.
 +      * decl2.c (maybe_warn_sized_delete): Likewise.
 +      * error.c (dump_expr): Use OOC_INFO.
 +      (parm_to_string): Use ovl_op_identifier.
 +      * init.c (build_new_1): Likewise.
 +      * lambda.c (lambda_function): Likewise.
 +      * lex.c (unqualified_name_lookup_error): Don't check ERROR_MARK.
 +      * mangle.c (write_unqualified_name): Use OOC_INFO.
 +      (write_expression): Likewise.
 +      * method.c (synthesized_method_walk): Use ovl_op_identifier.
 +      * parser.c (cp_parser_lambda_declarator_opt): Likewise.
 +      (cp_parser_operator): Likewise.
 +      (cp_parser_omp_clause_reduction): Likewise.
 +      * semantics.c (omp_reduction_id): Likewise.
 +      * typeck.c (cxx_sizeof_or_alignof_type): Use OOC_INFO.
 +      libcc1/
 +      * libcp1plugin.cc (plugin_build_decl): Use ovl_op_identifier.
 +      (plugin_build_dependent_expr): Likewise.
 +
 +      Operator code compaction part 2.
 +      gcc/cp/
 +      * cp-tree.h (IDENTIFIER_CP_INDEX): New.
 +      * call.c (op_error): Use ooc_info.
 +      (build_new_op_1): Likewise.
 +      (build_op_delete_call): Likewise.
 +      * error.c (assop_to_string): Delete.
 +      (op_to_string): Add assop arg. Use ooc_info.
 +      (dump_expr): Use ooc_info.
 +      (cp_printer): Adjust.
 +      * mangle.c (write_unqualified_name): Use ooc_info.
 +      * typeck.c (cxx_sizeof_or_alignof_type): Likewise.
 +
 +2017-10-25  Nathan Sidwell  <nathan@acm.org>
 +
 +      Operator code compaction part 1.
 +      gcc/cp/
 +      * cp-tree.h (enum overloaded_operator_codes): New.
 +      (struct ooc_info_t): New.
 +      (OOC_OPERATORS, OOC_ASSIGNMENTS): New.
 +      (ooc_info, ooc_mapping): Declare.
 +      * decl.c (grok_op_properties): Use ooc_info.
 +      * lex.c (ooc_info, ooc_mapping): Define.
 +      (set_operator_ident): New.
 +      (init_operators): Initialize ooc_info, ooc_mapping.
 +      * mangle.c (write_unqualified_id): Use ooc_info.
 +      (write_expression): Use ooc_mapping and ooc_info.
 +      * operators.def: Conditionally define DEF_ASSN_OPERATOR.  Move
 +      assignment ops later.  Invoke OPERATOR_TRANSITION.
 +
 +      Merge trunk r254084.
 +
 +      Kill IDENTIFIER_LABEL_VALUE.
 +      gcc/cp/
 +      * cp-tree.h (lang_identifier): Delete label_value slot.
 +      (IDENTIFIER_LABEL_VALUE, SET_IDENTIFIER_LABEL_VALUE): Delete.
 +      (struct named_label_hasher): Rename to ...
 +      (struct named_label_hash): ... here.  Reimplement.
 +      (struct language_function): Adjust x_named_labels.
 +      (lookup_label): Declare here too.
 +      * decl.c (struct named_label_entry): Add name and outer slots.
 +      (pop_label): Rename to ...
 +      (check_label_used): ... here.  Don't pop.
 +      (note_label, sort_labels): Delete.
 +      (pop_labels, pop_local_label): Reimplement.
 +      (poplevel): Pop local labels as any other decl. Remove
 +      shadowed_labels handling.
 +      (named_label_hash::hash, named_label_hash::equal): New.
 +      (make_label_decl): Absorb into ...
 +      (lookup_label_1): ... here.  Add making_local_p arg, reimplement.
 +      (lookup_label, declare_local_label): Adjust.
 +      (identify_goto, check_previous_goto, check_goto): Adjust.
 +      (check_omp_return, define_label_1, define_label): Adjust.
 +      * lex.c (make_conv_op_name): Don't clear IDENTIFIER_LABEL_VALUE.
 +      * name-lookup.h (struct cp_label_binding): Delete.
 +      (struct cp_binding_level): Delete shadowed_labels slot.
 +      * ptree.c (cxx_print_identifier): Don't print identifier binding.
 +
 +2017-10-20  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * class.c (layout_class_type): Cleanup as-base creation, determine
 +      mode here.
 +      (finish_struct_1): ... not here.
 +
 +2017-10-19  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * cp-tree.h (LAMBDA_FUNCTION_P): Use
 +      DECL_OVERLOADED_OPERATOR_IS.
 +      (DECL_OVERLOADED_OPERATOR_P): Just be a predicate.
 +      (DECL_VERLOADED_OPERATOR_IS): New.
 +      (DECL_OVERLOADED_OPERAT_CODE): New.
 +      * call.c (add_function_candidate): Use
 +      DECL_OVERLOADED_OPERATOR_IS.
 +      (build_op_call_1, build_over_call): Likewise.
 +      * decl.c (duplicate_decls): Adjust DECL_OVERLOADED_OPERATOR_P,
 +      USE_DECL_OVERLOADED_OPERATOR_CODE.
 +      (start_preparsed_function): Use DECL_OVERLOADED_OPERATOR_IS.
 +      * decl2.c (mark_used): Likwise.
 +      * dump.c (dump_op): Delete.
 +      (cp_dump_tree): Don't call it.
 +      * mangle.c (wite_unqualified_name): Use
 +      DECL_OVERLOADED_OPERATOR_CODE.
 +      * method.c (synthesize_method): Use DECL_OVERLOADED_OPERATOR_IS.
 +      (defaultable_fn_check): LIkewise.
 +      * tree.c (special_function_p): Likewise.
 +      * typeck.c (check_return_expr): Use IDENTIFIER_NEWDEL_OP_P.
 +
 +      gcc/cp/
 +      * lex.c (get_identifier_kind_name): Fix names.
 +      (init_operators): Nuke extraneous operators.
 +      * operators.def (DEF_OPERATOR): Fix documentation.
 +      (DEF_ASSN_OPERATOR): Lose ARITY.
 +      (DEF_SIMPLE_OPERATOR, DEF_ASSN_OPERATOR): Undef at end.
 +
 +2017-10-17  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253836.
 +
 +      gcc/cp/
 +      * name-lookup.c (get_member_vec_index): New. Broken out of ...
 +      (member_vec_binary_search): ... here.  Use it.
 +      (member_vec_linear_search): Delete.
 +      (fields_linear_search, get_class_binding_direct): Adjust.
 +      (get_member_slot): Use get_member_vec_index, reorganize.
 +
 +2017-10-13  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253733
 +
 +      gcc/
 +      * tree.c (tree_code_size): Reformat.  Punt to lang hook for unknown
 +      TYPE nodes.
 +      gcc/cp/
 +      * cp-objcp-common.c (cp_tree_size): Reformat.  Adjust returns size
 +      of TYPE nodes.
 +      * cp-tree.h (PACK_EXPANSION_PATTERN): Correct formatting.
 +      gcc/objc/
 +      * objc-act.c (objc_common_tree_size): Return size of TYPE nodes.
 +
 +      Merge trunk r253723.
 +
 +2017-10-11  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253649.
 +
 +      gcc/
 +      * incpath.h (enum incpath_e): Name enum, prefix values.
 +      (add_path, add_cpp_dir_path, get_added_cpp_dirs): Use incpath_e type.
 +      * incpath.c (heads, tails): Use INC_MAX.
 +      (add_env_var_paths, add_standard_paths): Use incpath_e type.
 +      (merge_include_chains, split_quote_chain,
 +      register_include_chains): Update incpath_e names.
 +      (add_cpp_dir_path, add_path, get_added_cpp_dirs): Use incpath_e type.
 +      * config/darwin-c.c (add_system_framework_path): Update incpath_e
 +      names.
 +      (add_framework_path, darwin_register_objc_includes ): Likewise.
 +      * config/vms/vms-c.c (vms_c_register_includes): Likewise.
 +
 +      gcc/fortran/
 +      * cpp.c (gfc_cpp_add_include_path): Update incpath_e names.
 +      (gfc_cpp_add_include_path_after): Likewise.
 +
 +      gcc/c-family/
 +      * c-opts.c (add_prefixed_path): Change chain to incpath_e type.
 +      (c_common_handle_option): Update incpath_e names.
 +
 +      Merge trunk r253623
 +
 +2017-10-10  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253619.
 +
 +2017-10-06  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253485.
 +
 +      gcc/cp/
 +      * cp-tree.h (struct default_hash_traits <lang_identifier *>):
 +      Delete specialization.
 +
 +2017-10-05  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * name-lookup.c (extern_c_fns): Use hash_table<named_decl_hash>.
 +      (check_extern_c_conflict, c_linkage_bindings): Adjust.
 +
 +      gcc/cp/
 +      * cp-tree.h (struct named_decl_hash): New.
 +      (lang_decl_ns): Change type of bindings field.
 +      * lex.c (maybe_add_lang_decl_raw): Adjust.
 +      * name-lookup.c (find_namespace_slot): Adjust.
 +
 +      gcc/cp/
 +      * decl2.c (struct mangled_decl_hash): New.
 +      (mangled_decls): Use a hash_table, not map.
 +      (generate_mangled_alias, record_mangling): Adjust.
 +      gcc/
 +      * tree.h (DECL_ASSEBLER_NAME_RAW): New.
 +      (DECL_ASSEBLER_NAME_SET_P, SET_DECL_ASSEMBLER_NAME): Use it.
 +
 +      gcc/cp/
 +      * name-lookup.c (set_global_binding): No need for stat_hack.
 +
 +      Merge trunk r253446.
 +
 +      gcc/cp/
 +      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 (identifier_global_value): Use get_global_binding.
 +      (set_global_binding): Adjust arg name.
 +      * 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.
 +
 +2017-10-04  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r253413.
 +
 +      gcc/cp/
 +      * cp-tree.h (SET_IDENTIFIER_GLOBAL_VALUE): Drop NAME arg.
 +      * decl.c (record_builtin_type): Adjust SET_IDENTIFIER_GLOBAL_VALUE.
 +      * decl2.c (get_local_tls_init_fn, get_tls_init_fn): Likewise.
 +      * name-lookup.c (set_global_binding): Drop NAME arg.
 +      * name-lookup.h (set_global_binding): Drop NAME arg.
 +
 +      gcc/cp/
 +      * decl.c (record_builtin_type): Reimplement. Push decls with
 +      matching name.
 +
 +      gcc/cp/
 +      * cp-tree.h (record_mangling): Adjust arg types.
 +      * decl2.c (mangled_decls): New hash_map.
 +      (generate_mangling_alias): Use mangled_decls, not
 +      IDENTFIFIER_GLOBAL_VALUE.
 +      (decl_implicit_alias_p): Delete.
 +      (record_mangling): Use mangled_decls, not
 +      IDENTIFIER_GLOBAL_VALUE. Diagnose conflict here.
 +      * mangle.c (mangle_decl): Adjust record_mangling call.  Don't
 +      diagnose here.
 +      * name-lookup.c (set_global_binding): Remove temporary hack.
 +      gcc/testsuite/
 +      * g++.dg/abi/mangle41.C: Adjust diags.
 +      libcc1/
 +      * libcp1plugin.cc (supplement_binding): Don't call
 +      maybe_remove_implicit_alias.
 +
 +2017-10-03  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * cp-tree.h (record_mangling): Declare.
 +      (maybe_remove_implicit_alias): Delete.
 +      * mangle.c (maybe_remove_implicit_alias): Delete.
 +      (mangle_decl): Use record_mangling.
 +      (decl_implicit_alias_p): Move to ...
 +      * decl2.c (decl_implicit_alias_p): ... here.
 +      (record_mangling): New.
 +      * name-lookup.c (supplement_binding_1): Delete implicit_alias
 +      handling.
 +      (set_global_binding): Allow zapping a slot, for now.
 +
 +2017-09-13  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r252087.
 +
 +2017-09-06  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r251808.
 +
 +      Merge trunk r251780.
 +
 +2017-09-05  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r251721.
 +
 +      gcc/cp/
 +      * cp-tree.h (DECL_TEMPLATE_CONV_FN_P): Delete.
 +      * pt.c (push_template_decl_real): Don't set it.
 +
 +      gcc/cp/
 +      * cp-tree.h (DECL_CONV_FN_P): No need to check DECL_NAME nullness.
 +      (DECL_CONV_FN_TYPE): FN must be a conv op.
 +
 +      gcc/cp/
 +      * class.c (add_method): Move conv_op marker handling to ...
 +      * name-lookup.c (find_method_slot): ... here.
 +
 +      gcc/cp/
 +      * name-lookup.h (get_class_binding_direct, get_class_binding):
 +      Merge want_type and restricted args.
 +      * name-lookup.c (get_class_binding_direct): Merge want_type and
 +      restricted args.  Adjust.
 +      (get_class_binding): Adjust for argument merge.
 +      * decl.c (reshape_init_class): Adjust get_class_binding call.
 +      * search.c (lookup_field_r): Adjust get_class_binding call.
 +
 +      Kill CLASSTYPE_SORTED_FIELDS
 +      gcc/cp/
 +      * cp-tree.h (struct lang_type): Delete sorted_fields.
 +      (CLASSTYPE_SORTED_FIELDS): Delete.
 +      gcc/c-family/
 +      * c-common.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp, resort_sorted_fields): Move ...
 +      * c-common.h (field_decl_cmp, resort_sorted_fields): ... and ...
 +      (struct sorted_fields_type): ... and to ...
 +      gcc/c/
 +      * c-decl.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp, resort_sorted_fields): Here and ...
 +      * c-lang.h (struct sorted_fields_type): here..
 +
 +      Merge TYPE_FIELDS to METHOD_VEC
 +      gcc/cp/
 +      * name-lookup.c (method_vec_binary_search,
 +      method_vec_linear_search): New.  Broken out of ...
 +      (legacy_fn_member_lookup): ... here.  Delete.
 +      (fields_linear_search): New.  Broken out of ...
 +      (legacy_nonfn_member_lookup): ... here.  Delete.
 +      (find_method_slot): Call set_class_bindings if adding method_vec
 +      to completed class.
 +      (get_class_binding_direct): Use new searching functions.
 +      (method-name_cmp): Order identically named decls.
 +      (resort_method_name_cmp): Adjust.
 +      (sorted_fields_type_new): Delete.
 +      (count_fields): Rename to ...
 +      (count_class_fields): ... here.  Take RECORD_TYPE and adjust.
 +      (add_fields_to_record_type): Rename to ...
 +      (method_vec_append_class_fields): ... here.  Take RECORD_TYPE and
 +      adjust.
 +      (add_enum_fields_to_record_type): Rename to ...
 +      (method_vec_append_enum_values): ... here.  Adjust.
 +      (method_vec_dedup): New.
 +      (set_class_bindings): Reimplement.
 +      (insert_late_enum_def_bindings): Reimplement.
 +      * name-lookup.h (lookup_field_1, lookup_fnfields_slot,
 +      lookup_fnfields_slot_nolazy): Delete.
 +      (get_class_binding_direct, get_class_binding, find_method_slot): Move.
 +      (set_class_bindings): Add EXTRA parm.
 +      * class.c (warn_hidden): Cope with non-functions.
 +      * decl.c (cxx_init_decl_processing): Make conv-op marker function
 +      not so bogusly typed.
 +
 +2017-09-01  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r251609.
 +
 +      gcc/cp/
 +      * class.c (warn_hidden): Clean up.
 +      (clone_constructors_and_destructors): No need to check METHOD_VEC.
 +      (type_has_user_provided_constructor): Likewise.
 +      (type_has_user_provided_or_explicit_constructor): Likewise.
 +      (classtype_has_move_assign_or_move_ctor_p): Likewise.
 +      (finish_struct): Adjust comment.
 +
 +      gcc/cp/
 +      * cp-tree.h (resort_type_method_vec): Move declaration to ...
 +      * name-lookup.h (resort_type_method_vec): ... here.
 +      * class.c (finish_struct_1, finish_struct): Adjust
 +      set_class_bindings call.  Don't call finish_struct_methods.
 +      (resort_data, method_name_cmp, resort_method_name_cmp,
 +      resort_type_method_vec, finish_struct_methods): Move to ...
 +      * name-lookup.c (resort_data, method_name_cmp,
 +      resort_method_name_cmp, resort_type_method_vec): ... here.
 +      (set_class_bindings): Lose fields arg.  Swallow finish_struct_methods.
 +
 +      Merge trunk r251592.
 +
 +      gcc/cp/
 +      * class.c (finish_struct): Also call set_class_bindings in
 +      template case.
 +
 +2017-08-31  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * class.c (finish_struct_1): Move finish_struct_methods and
 +      set_class_bindings to just after layout.
 +      (finish_struct): Process using_decls before setting template
 +      pseudo-size. Call finish_struct_methods immediately after.
 +
 +      gcc/cp/
 +      * class.c (finish_struct_methods): Don't warn about private bases
 +      here.
 +      (finish_struct_1): Move set_class_bindings as late as possible.
 +      (finish_struct): Warn about overly private bases after completing
 +      the type.
 +
 +      gcc/cp/
 +      * class.c (finish_struct_methods): Move DECL_IN_AGGR_P frobbing to
 +      finish_struct_1.
 +      (check_bases_and_members): Move finish_struct_methods to ...
 +      (finish_struct_1): ... here.  Frob DECL_IN_AGGR_P.
 +      (unreverse_member_declarations): Remove unneeded if.
 +      * method.c (lazily_declare_fn): Adjust comment.
 +      * pt.c (do_class_deduction): No need to check CLASSTYPE_METHOD_VEC.
 +      * tree.c (type_has_nontrivial_copy_init): Likewise.
 +
 +      gcc/cp/
 +      * class.c (add_method): Use find_method_slot.
 +      * name-lookup.h (find_method_slot): Declare.
 +      * name-lookup.c (legacy_fn_member_lookup): Allow NULL slot in
 +      incomplete type.
 +      (find_method_slot): Use.
 +      * decl.c (grok_special_member_properties): Check conv-op here.
 +
 +      Restore get_class_binding name.
 +      gcc/cp/
 +      * name-lookup.c (get_class_value, get_class_value_direct): Rename
 +      to ...
 +      (get_class_binding, get_class_binding_direct): ... here.
 +      * name-lookup.h (get_class_value, get_class_value_direct): Rename
 +      to ...
 +      (get_class_binding, get_class_binding_direct): ... here.
 +      * call.c (builduser_type_conersion_1): Rename calls.
 +      (has_trivial_copy_assign_p, has_trvial_copy_p): Likewise.
 +      * class.c (vbase_has_user_provided_move_assign,
 +      classtype_has_move_assign_or_move_ctor_p, type_build_ctor_call,
 +      type_build_dtor_call): Likewise.
 +      * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Likewise.
 +      * decl.c (reshape_init_class, register_dtor_fn): Likewise.
 +      * decl2.c (check_classfn): Likewise.
 +      * pt.c (retrieve_specialization,
 +      check_explicit_specialization): Likewise.
 +      * search.c (lookup_field_r, look_for_overrides_here,
 +      lookup_conversions_r): Likewise.
 +      * semantics.c (classtype_has_nothrow_assign_or_copy_p): Likewise.
 +
 +      gcc/cp/
 +      * name-lookup.c (insert_late_enum_def_bindings): Swap args.
 +      * decl.c (finish_enum_value_list): Adjust
 +      insert_late_enum_def_bindings call.
 +
 +      Restore lang_type::sorted_fields
 +      gcc/c/
 +      * c-decl.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp, resort_sorted_fields): Moved back to ...
 +      * c-lang.h (struct sorted_fields_type): ...
 +      gcc/c-family
 +      * c-common.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp, resort_sorted_fields): ... here ...
 +      * c-common.h (field_decl_cmp, resort_sorted_fields): ... here ...
 +      (struct sorted_fields_type): ... here.
 +      gcc/cp/
 +      * cp-tree.h (struct lang_type): Restore sorted_fields.
 +      (CLASSTYPE_SORTED_FIELDS): Restore.
 +      (CLASSTYPE_BINDINGS): Delete.
 +      * decl.c (finish_enum_value_list): Adjust
 +      insert_late_enum_def_bindings call.
 +      * name-lookup.c (legacy_nonfn_member_lookup): Restore binary
 +      search.
 +      (get_class_value_direct): Remove binding table code.
 +      (sorted_fields_type_new, count_fields, 
 +      add_fields_to_record_type, add_enum_fields_to_record_type): Restore.
 +      (add_class_member, add_class_members): Delete.
 +      (set_class_bindings, insert_late_enum_def_bindings): Adjust.
 +
 +      Merge trunk r251560.
 +
 +2017-08-29  Nathan Sidwell  <nathan@acm.org>
 +
 +      Anonymous namespace has NULL name
 +      gcc/cp/
 +      * cp-tree.h (default_hash_traits <lang_identifier *>): Permit
 +      NULL.
 +      * name-lookup.c (do_pushdecl): Push NULL-named namespace.
 +      (do_push_nested_namespace): Adjust.
 +      (push_namespace): Push anonymous namespace as NULL name.
 +
 +2017-08-28  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r251385.
 +
 +      gcc/cp/
 +      * name-lookup.c (do_class_using_decl): Simplify.
 +
 +2017-08-25  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * name-lookup.h (lookup_class_member): Delete.
 +      * name-lookup.c (lookup_class_member): Merge into ...
 +      (get_class_value): ... here.
 +      (legacy_nonfn_member_lookup): Don't call it.
 +
 +      Merge trunk r251351.
 +
 +2017-08-24  Nathan Sidwell  <nathan@acm.org>
 +
 +      Rename get_class_binding -> get_class_value
 +      * name-lookup.c (get_class_binding, get_class_binding_direct): Rename
 +      to ...
 +      (get_class_value, get_class_value_direct): ... here.
 +      * name-lookup.h (get_class_binding, get_class_binding_direct): Rename
 +      to ...
 +      (get_class_value, get_class_value_direct): ... here.
 +      * call.c (builduser_type_conersion_1): Rename calls.
 +      (has_trivial_copy_assign_p, has_trvial_copy_p): Likewise.
 +      * class.c (vbase_has_user_provided_move_assign,
 +      classtype_has_move_assign_or_move_ctor_p, type_build_ctor_call,
 +      type_build_dtor_call): Likewise.
 +      * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Likewise.
 +      * decl.c (reshape_init_class, register_dtor_fn): Likewise.
 +      * decl2.c (check_classfn): Likewise.
 +      * pt.c (retrieve_specialization,
 +      check_explicit_specialization): Likewise.
 +      * searh.c (lookup_field_r, look_for_overrides_here,
 +      lookup_conversions_r): Likewise.
 +      * semantics.c (classtype_has_nothrow_assign_or_copy_p): Likewise.
 +
 +2017-08-23  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * name-lookup.c (extract_conversion_operator,
 +      legacy_fn_member_lookup, legacy_nonfn_member_lookup,
 +      get_class_binding_direct, get_class_binding, lookup_class_member,
 +      add_class_member, add_class_members, set_class_bindings,
 +      insert_late_enum_def_bindings): Move earlier to match trunk.
 +
 +      Merge trunk r251313.
 +
 +      gcc/cp/
 +      * name-lookup.h (get_class_binding_direct, get_class_binding): Add
 +      temporary restricted parm.
 +      * name-lookup.c (get_class_binding_direct): Replace fn_only with
 +      restricted.
 +      (get_class_binding): Adjust.
 +      * decl.c (reshape_init_class): get_class_binding is differently
 +      restricted.
 +      * search.c (lookup_field_r): get_class_binding is not restricted.
 +      gcc/testsuite/
 +      * g++.dg/cpp0x/decltype9.C: Revert, not ready yet.
 +
 +      gcc/cp/
 +      * semantics.c (finish_member_declaration): Move USING_DECL check.
 +      Always set lang_cplusplus.  Commonize decl linking.
 +
 +2017-08-22  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * name-lookup.c (legacy_fn_member_lookup): Move conv_op processing
 +      to get_class_binding_direct.
 +      (legacy_nonfn_member_lookup): Move asserts to
 +      get_class_binding_direct.
 +      (get_class_binding_direct): Abosorb asserts and conv_op processing.
 +
 +      gcc/cp/
 +      * cp-tree.h (print_search_statistics,
 +      reinit_search_statistics): Delete.
 +      * tree.c (cxx_print_statistics): Don't print search stats.
 +      * search.c (n_fields_searched, n_calls_lookup_field,
 +      n_calls_lookup_field_1, n_calls_lookup_fnfields,
 +      n_calls_lookup_fnfields_1, n_calls_get_base_type,
 +      n_outer_fields_searched, n_contexts_saved): Delete.
 +      (lookup_member): Delete stats.
 +      (print_search_statistics, reinit_search_statistics): Delete.    
 +
 +      Merge trunk r251283.
 +
 +      gcc/cp/
 +      * cp-tree.h (lookup_field_1, lookup_fnfields_slot_nolazy): Delete.
 +      * name-lookup.h (lookup_all_conversions): Delete.
 +      * decl2.c (check_classfn): Lookup conversions directly.
 +      * pt.c (check_explicit_specialization): Likewise.
 +      * search.c (lookup_conversion_operator,
 +      lookup_fnfields_slot_nolazy, lookup_field_1): Move to ...
 +      * name-lookup.c (extract_conversion_operator,
 +      legacy_fn_member_lookup, legacy_nonfn_member_lookup): ... here.
 +      Make static.
 +      (get_class_binding_direct): Adjust.
 +      (lookup_all_conversions): Delete.
 +
 +      gcc/cp/
 +      * cp-tree.h (lookup_fnfields_slot): Delete.
 +      * search.c (lookup_fnfields_slot): Delete.
 +      (look_for_overrides_here): Use get_class_binding.
 +      * call.c (build_user_type_conversion_1): Likewise.
 +      (has_trivial_copy_assign_p, has_trivial_copy_p): Likewise.
 +      * class.c (get_basefndecls, type_build_ctor_call,
 +      type_build_dtor_call): Likewise.
 +      * decl.c (register_dtor_fn): Likewise.
 +      * decl2.c (check_classfn): Likewise.
 +      * pt.c (retrieve_specialization,
 +      check_explicit_specialization): Likewise.
 +      * semantics.c (classtype_has_nothrow_assign_or_copy_p): Likewise.
 +
 +      gcc/cp/
 +      * name-lookup.h (get_class_binding_direct): Declare.
 +      (get_class_binding): Adjust.
 +      * name-lookup.c (get_class_binding_direct): New.
 +      (get_class_binding): Adjust.
 +      * cp-tree.h (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Use
 +      get_class_binding_direct.
 +      * class.c (vbase_has_user_provided_move_assign): Likewise.
 +      (classtype_has_move_assign_or_move_ctor_p): Likewise.
 +      * decl2.c (check_classfn): Skip non-functions.
 +      * search.c (lookup_fnfields_slot): Forward to get_class_binding.
 +      (lookup_conversions_r): Use get_class_binding_direct.
 +      gcc/testsuite/
 +      * g++.dg/cpp0x/decltype9.C: Adjust messages.
 +
 +2017-08-21  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * decl.c (reshape_init_class): Use get_class_binding.
 +      * name-lookup.c (get_class_binding): New.
 +      * name-lookup.h (get_class_binding): Declare.
 +      * search.c (lookup_field_r): Use get_class_binding.
 +
 +      gcc/cp/
 +      * search.c (lookup_field_r): Remove obsolete code for type-named
 +      field in PoD.
 +
 +      Merge trunk r251241.
 +
 +      gcc/cp/
 +      * search.c (lookup_field_1) : Assert TYPE is a class.  Assert
 +      vfield is not special.
 +      (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete.
 +      (lookup_field_fuzzy_r): Adjust.
 +
 +2017-08-17  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r251159.
 +
 +2017-07-27  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * cp-tree.h (maybe_version_functions): Declare.
 +      * decl.c (maybe_version_functions): New.  Broken out of ...
 +      (decls_match): ... here.  Call it.
 +      * class.c (add_method): Add asserts, use maybe_version_functions.
 +
 +      Add conversion marker fn.
 +      gcc/cp/
 +      * cp-tree.h (CPTI_CONV_OP_MARKER, conv_op_marker): New.
 +      * decl.c (initialize_predefined_identifiers): conv_op is conv_op.
 +      (cxx_init_decl_processing): Create conv_op_marker.
 +      * class.c (add_method): Compare identifiers.  Insert
 +      conv_op_marker for conv op overloads.
 +      (method_name_cmp, resort_method_name): Compare identifiers.
 +      * lex.c (make_conv_op_name): No need to set identifier kind.
 +      * search.c (lookup_fnfields_slot_nolazy): Compare identifiers,
 +      deal with conv_op_marker.
 +
 +2017-07-21  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r250440.
 +
 +      Merge trunk r250437.
 +
 +      gcc/
 +      * dbxout.c: Restore from trunk.
 +
 +      Merge trunk r250426.
 +
 +      Conv ops are regular METHODVEC fns.
 +      gcc/cp/
 +      * cp-tree.h (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete.
 +      * class (add-method): Treat conv ops as regular fns.
 +      (resort_type_method_vec, finish_struct_methods, warn_hidden) No
 +      need to skip conversion ops.
 +      * decl.c (initialize_predefined_identifiers): Naked
 +      conv_op_identifier is not a conv op.
 +      * lex.c (make_conv_op_name): Set identifier kind.
 +      * name-lookup.c (lookup_all_conversions): Use
 +      lookup_fnfields_slot_nolazy.
 +      * search.c (lookup_conversion_operator): Process passed in
 +      overload set.
 +      (lookup_fnfields_slot_nolazy): Don't skip conversion ops.  Process
 +      conversions after lookup.
 +      (lookup_conversions_r): Use lookup_fnfields_slot_nolazy.
 +
 +2017-07-20  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r250413.
 +
 +      Method vec sorted by identifier pointer (not conv ops)
 +      gcc/cp/
 +      * class.c (add_method): Use IDENTIFIER_POINTER.
 +      (method_name_cmp, resort_method_name_cmp): Likewise. DECL_NAME can
 +      never be NULL.
 +      * search.c (lookup_fnfields_slot_nolazy): Use IDENTIFIER_POINTER.
 +
 +      Conv op names all same.
 +      gcc/cp/
 +      * cp-tree.h (CPTI_CONV_OP_IDENTIFIER): New.
 +      (conv_op_identifier): New.
 +      * decl.c (initialize_predefined_identifiers): Add it.
 +      * lex.c (make_conv_op_name): Names are not in the symbol table.
 +
 +      All conv ops on one slot.
 +      gcc/cp/
 +      * class.c (add_method): Put conversion ops on a single slot.
 +      * name-lookup.c (lookup_all_conversions): Only examine single
 +      slot.
 +      * search.c (lookup_conversion_operator): Examine single slot in
 +      detail to pull out requested conversions.
 +      (lookup_conversions_r): Lose tmp/non-tmpl distinction. All ops on
 +      one slot.
 +      (lookup_conversions): Likewise.
 +
 +      gcc/cp/
 +      * call.c (add_candidates): Move decls to initialization.  Don't
 +      use !!.
 +
 +      Merge trunk r250380.
 +
 +2017-07-19  Nathan Sidwell  <nathan@acm.org>
 +
 +      Merge trunk r250344.
 +
 +2017-07-18  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/cp/
 +      * search.c (lookup_conversion_operator): Return overloads not
 +      index.
 +      (lookup_fnfields_idx_nolazy): Absorb into ...
 +      (lookup_fnfields_slot_nolazy): ... this.
 +      (lookup_fnfields_1): Absorb into ...
 +      (lookup_fnfields_slot): ... this.
 +
 +      Merge trunk r250313.
 +
 +      Rename TYPE_{MIN,MAX}VAL to TYPE_{MIN,MAX}VAL_RAW.
 +      gcc/c/
 +      * c-parser.c (c_parser_array_notation): Use TYPE_{MIN,MAX}_VALUE.
 +      gcc/c-family/
 +      * c-warn.c (warn_for_memset): Use TYPE_{MIN,MAX}_VALUE.
 +      gcc/cp/
 +      * cp-array-notation.c (build_array_notation_ref): Use
 +      TYPE_{MIN,MAX}_VALUE.
 +      * cp-tree.h (PACK_EXPANSION_PARAMETER_PACKS,
 +      PACK_EXPANSION_EXTRA_ARGS): Use TYPE_{MIN,MAX}VAL_RAW.
 +      fortran/
 +      * trans.c (gfc_build_array_ref): Use TYPE_{MIN,MAX}_VALUE.
 +      lto/
 +      * lto.c (mentions_vars_p_type): Use TYPE_{MIN,MAX}VAL_RAW.
 +      (compare_tree_sccs_1): Likewise.  Don't check BINFO directly.
 +      (lto_fixup_prevailing_decls): Use TYPE_{MIN,MAX}VAL_RAW.
 +      gcc/
 +      * tree.h (TYPE_MINVAL, TYPE_MAXVAL): Rename to ...
 +      (TYPE_MINVAL_RAW, TYPE_MAXVAL_RAW): ... these.
 +      * lto-streamer-out.c (DFS::DFS_write_tree_body): Use
 +      TYPE_{MIN,MAX}VAL_RAW.  Don't process BINFO directly.
 +      (hash_tree): Likewise.
 +      * tree-parloops.c (try_transform_to_exit_first_loop_alt): Use
 +      TYPE_MAX_VALUE.
 +      * tree-streamer-in.c (lto_input_ts_type_non_common_tree_pointers):
 +      Use TYPE_{MIN,MAX}VAL_RAW.  Don't process BINFO directly.
 +      * tree-streamer-out.c (write_ts_type_non_common_tree_pointers):
 +      Likewise.
 +      * tree.c (free_lang_data_in_type): Use switch, cleanup.
 +      (find_decls_types_r): Use TYPE_{MIN,MAX}VAL_RAW.  Don't process
 +      BINFO directly.
 +      (verify_type): Use TYPE_{MIN,MAX}VAL_RAW.  Move BINFO checking
 +      into RECORD check.
 +      objc/
 +      * objc-act.h (CLASS_NST_METHODS, CLASS_CLS_METHODS): Use
 +      TYPE_{MIN,MAX}VAL_RAW.
 +
 +2017-07-17  Nathan Sidwell  <nathan@acm.org>
 +
 +      Remove special ctor/dtor slots
 +      gcc/cp/
 +      * cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT,
 +      CLASSTYPE_DESTRUCTOR_SLOT): Delete.
 +      (CLASSTYPE_FIRST_CONVERSION_SLOT): Set to zero.
 +      * class.c (add_method): cdtors do not have specia slots.
 +      * search.c (lookup_fnfields_idx_nolazy): Likewise.
 +      (look_for_overrides_here): Use lookup_fnfields_slot.
 +
 +      Replace lang_type::sorted_fields with lang_type::bindings.
 +      (from c++modules branch)
 +      gcc/cp/
 +      * cp-tree.h (struct lang_type): Replace sorted_fields with
 +      bindings map.
 +      (CLASSTYPE_CONSTRUCTORS, CLASSTYPE_DESTRUCTOR): Use
 +      lookup_fnfields_slot_nolazy.
 +      (CLASSTYPE_SORTED_FIELDS): Replace with ...
 +      (CLASSTYPE_BINDINGS): ... this.
 +      (type_has_user_declared_move_constructor,
 +      type_has_user_declared_move_assign): Delete, replace with:
 +      (classtype_has_user_move_assign_or_ctor_p): ... this.
 +      (insert_late_enum_def_into_classtype_sorted_fields): Delete.
 +      (lookup_all_conversions): Delete.
 +      * decl.c (finish_enum_value_list): Use
 +      insert_late_enum_def_bindings.
 +      * method.c (maybe_explain_implicit_delete): Use
 +      classtype_has_user_move_assign_or_ctor_p.
 +      (lazily_declare_fn): Likewise.
 +      * class.c (maybe_warn_about_overly_private_class): Ignore
 +      copy/move ctors.
 +      (type_has_user_declared_move_constructor,
 +      type_has_user_declared_move_assign): Delete, replace with:
 +      (classtype_has_user_move_assign_or_ctor_p): ... this.
 +      (count_fields, add_fields_to_record_type,
 +      add_enum_fields_to_record_type, sorted_fields_type_new,
 +      create_classtype_sorted_fields,
 +      insert_late_enum_def_into_classtype_sorted_fields): Move to ...
 +      * name-lookup.c: ... here.
 +      (add_class_member, add_class_members, set_class_bindings): New.
 +      (lookup_class_member): New.  Broken out of ...
 +      * search.c (lookup_field_1): ... here.  Call it.
 +      (lookup_fnfields_idx_nolazy): Look directly at method_vec.
 +      (lookup_fnfields_slot_nolazy): Don't complete the type.
 +      (lookup_all_conversions): Move to name-lookup.c
 +      * semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
 +      lookup_fnfields_slot always.
 +      * tree.c (type_has_nontrivial_copy_init): Use
 +      classtype_has_user_move_assign_or_ctor_p.
 +      * name-lookup.h (lookup_class_member,
 +      set_class_bindings, insert_late_enum_def_binsings,
 +      lookup_all_conversions): Declare.
 +      * pt.c (check_explicit_specialization): Use lookup_fnfields_slot.
 +      * ptree.c (cxx_print_type): Delete sorted-fields.
 +      gcc/c-family/
 +      * c-common.h (field_decl_cmp, resort_sorted_fields): Delete.
 +      (struct sorted_fields_type): Move to c-lang.h.
 +      * c-common.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp): Move to c-decl.c.
 +      * c-ada-spec.c (decl_sloc): Ignore builtin fields.
 +      gcc/c/
 +      * c-decl.c (field_decl_cmp, resort_data,
 +      resort_field_decl_cmp): Moved from c-common.c
 +      * c-lang.h (struct sorted_fields_type): Moved from c-common.h.
 +
 +2017-07-12  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/
 +      * tree-core.h (struct tree_type_non_common): Rename binfo to
 +      lang_1.
 +      * tree.h (TYPE_BINFO): Move to maxval field.
 +      (TYPE_LANG_SLOT_1): Allow any type.
 +      gcc/lto/
 +      * lto.c (mentions_vars_p_type, lto_fixup_prevailing_decls): Use
 +      TYPE_LANG_SLOT_1, not binfo.
 +
 +2017-07-11  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/
 +      * tree.h (TYPE_METHODS): Delete.
 +      * tree.c (free_lang_data_in_type): Stitch out member functions and
 +      templates from TYPE_FIELDS.
 +      (build_distinct_type_copy, verify_type_variant,
 +      verify_type): Member fns are on TYPE_FIELDS.
 +      * tree-dump.c (dequeue_and_dump): No TYPE_METHODS.
 +      * tree-pretty-print.c (dump_generic_node): Likewise.
 +      * dbxout.c (dbxout_type_fields): Member fns are on TYPE_FIELDS.
 +      (dbxout_type_method_1, dbxout_type_methods): Delete.
 +      (dbxout_type_fn_member): New, constructed from previous.
 +      (dbxout_type): No TYPE_METHODS scan.
 +      * dwarf2out.c (gen_member_die): Member fns are on TYPE_FIELDS.
 +      * function.c (use_register_for_decl): Always ignore register for
 +      class types when not optimizing.
 +      * ipa-devirt.c (odr_types_equivalent_p): Delete TYPE_METHODS scan.
 +      gcc/c-family/
 +      * c-ada-spec.c (is_tagged_type, has_nontrivial_methods,
 +      dump_ada_template, print_ada_methods,
 +      print_ada_declaration): Member fns are on TYPE_FIELDS.
 +      gcc/cp/
 +      * class.c (maybe_warn_about_overly_private_class,
 +      finish_struct_methods, one_inheriting_sig, count_fields,
 +      add_fields_to_record_type, check_field_decls, check_methods,
 +      clone_function_decl, set_method_tm_attributes,
 +      finalize_literal_type_property, check_bases_and_members,
 +      create_vtable_ptr, determine_key_method,
 +      unreverse_member_declarations, finish_struct,
 +      add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
 +      * decl.c (fixup_anonymous_aggr): Likewise.
 +      * decl2.c (reset_type_linkage_2): Likewise.
 +      * method.c (after_nsdmi_defaulted_late_checks,
 +      lazily_declare_fn): Likewise.
 +      * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
 +      * pt.c (instantiate_class_template_1, tsubst_expr,
 +      do_type_instantiation, instantiate_pending_templates): Likewise.
 +      * search.c (lookup_field_1): Likewise.
 +      * semantics.c (finish_member_declaration,
 +      finish_omp_declare_simd_methods): Likewise.
 +      gcc/objc/
 +      * objc-runtime-shared-support.c (build_ivar_list_initializer):
 +      Don't presume first item is a FIELD_DECL.
 +      libcc1/
 +      * libcp1plugin.cc (plugin_build_decl): Member fns are on TYPE_FIELDS.
 +      gcc/testsuite/
 +      * g++.dg/ext/anon-struct6.C: Adjust diag.
 +      * g++.old-deja/g++.other/anon4.C: Adjust diag.
 +
 +      gcc/cp/
 +      * decl2.c (mark_used): Reformat.
 +      * pt.c (instantiate_class_member): Delete.
 +
 +2017-07-05  Nathan Sidwell  <nathan@acm.org>
 +
 +      gcc/
 +      * tree.h (TYPE_METHODS): Delete.
 +      * tree.c (free_lang_data_in_type): Stitch out member functions and
 +      templates from TYPE_FIELDS.
 +      (build_distinct_type_copy, verify_type_variant,
 +      verify_type): Member fns are on TYPE_FIELDS.
 +      * tree-dump.c (dequeue_and_dump): No TYPE_METHODS.
 +      * tree-pretty-print.c (dump_generic_node): Likewise.
 +      * dbxout.c (dbxout_type_fields): Member fns are on TYPE_FIELDS.
 +      (dbxout_type_method_1, dbxout_type_methods): Delete.
 +      (dbxout_type_fn_member): New, constructed from previous.
 +      (dbxout_type): No TYPE_METHODS scan.
 +      * dwarf2out.c (gen_member_die): Member fns are on TYPE_FIELDS.
 +      * function.c (use_register_for_decl): Always ignore register for
 +      class types when not optimizing.
 +      * ipa-devirt.c (odr_types_equivalent_p): Delete TYPE_METHODS scan.
 +      gcc/c-family/
 +      * c-ada-spec.c (is_tagged_type, has_nontrivial_methods,
 +      dump_ada_template, print_ada_methods,
 +      print_ada_declaration): Member fns are on TYPE_FIELDS.
 +      gcc/cp/
 +      * class.c (maybe_warn_about_overly_private_class,
 +      finish_struct_methods, one_inheriting_sig, count_fields,
 +      add_fields_to_record_type, check_field_decls, check_methods,
 +      clone_function_decl, set_method_tm_attributes,
 +      finalize_literal_type_property, check_bases_and_members,
 +      create_vtable_ptr, determine_key_method,
 +      unreverse_member_declarations, finish_struct,
 +      add_vcall_offset_vtbl_entries_1): Member fns are on TYPE_FIELDS.
 +      * decl.c (fixup_anonymous_aggr): Likewise.
 +      * decl2.c (reset_type_linkage_2): Likewise.
 +      * method.c (after_nsdmi_defaulted_late_checks,
 +      lazily_declare_fn): Likewise.
 +      * optimize.c (maybe_thunk_body, maybe_clone_body): Likewise.
 +      * pt.c (instantiate_class_template_1, tsubst_expr,
 +      do_type_instantiation, instantiate_pending_templates): Likewise.
 +      * search.c (lookup_field_1): Likewise.
 +      * semantics.c (finish_member_declaration,
 +      finish_omp_declare_simd_methods): Likewise.
 +      libcc1/
 +      * libcp1plugin.cc (plugin_build_decl): Member fns are on TYPE_FIELDS.
 +      gcc/testsuite/
 +      * g++.dg/ext/anon-struct6.C: Adjust diag.
 +      * g++.old-deja/g++.other/anon4.C: Adjust diag.
 +
 +      gcc/cp/
 +      * decl2.c (mark_used): Reformat.
 +      * pt.c (instantiate_class_member): Delete.
 +
 +      Branch creation from trunk:250000
 +      Use this Changelog for all branch changes, including merges.
 +
 +Local Variables:
 +mode: change-log
 +change-log-default-name: "ChangeLog.name-lookup"
 +End:
Simple merge
diff --cc gcc/cp/class.c
index 98e62c6ad45009b0710e57060cd8a1c998bc9dd4,25753d4c45f94e7d0de398da8e9d4e1ceaa43746..8d326d5f26d4c9456d0a788a7048ee4de34c3766
@@@ -1011,14 -1002,11 +1002,11 @@@ add_method (tree type, tree method, boo
    if (method == error_mark_node)
      return false;
  
-   /* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc.  */
-   grok_special_member_properties (method);
+   gcc_assert (!DECL_EXTERN_C_P (method));
  
 -  tree *slot = find_member_slot (type, DECL_NAME (method));
 -  tree current_fns = slot ? *slot : NULL_TREE;
 +  tree *slot = get_member_slot (type, DECL_NAME (method));
 +  tree current_fns = *slot;
  
-   gcc_assert (!DECL_EXTERN_C_P (method));
    /* Check to see if we've already got this method.  */
    for (ovl_iterator iter (current_fns); iter; ++iter)
      {
  
    current_fns = ovl_insert (method, current_fns, via_using);
  
-   if (!DECL_CONV_FN_P (method) && !COMPLETE_TYPE_P (type))
-     push_class_level_binding (DECL_NAME (method), current_fns);
+   if (!COMPLETE_TYPE_P (type) && !DECL_CONV_FN_P (method)
+       && !push_class_level_binding (DECL_NAME (method), current_fns))
 -    return false;
 -
 -  if (!slot)
 -    slot = add_member_slot (type, DECL_NAME (method));
++    {
++      unget_member_slot (type, slot);
++      return false;
++    }
+   /* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc.  */
+   grok_special_member_properties (method);
  
    *slot = current_fns;
  
diff --cc gcc/cp/decl.c
Simple merge
diff --cc gcc/cp/error.c
index 583493068d6e6d54123278a0a6afecb0a4943ab7,374ab0dd804fe6843a3efd010eaebf3042c1c436..03d8c5dc6654d2605c95ca4cf95aff5483d4d043
@@@ -2227,9 -2216,13 +2216,13 @@@ dump_expr (cxx_pretty_printer *pp, tre
        dump_binary_op (pp, "+", t, flags);
        break;
  
+     case POINTER_DIFF_EXPR:
+       dump_binary_op (pp, "-", t, flags);
+       break;
      case INIT_EXPR:
      case MODIFY_EXPR:
 -      dump_binary_op (pp, OVL_OP_INFO (true, NOP_EXPR)->name, t, flags);
 +      dump_binary_op (pp, ovl_op_info[1][OVL_OP_NOP_EXPR].name, t, flags);
        break;
  
      case PLUS_EXPR:
index a12a4ffc0eb98e8a5a69ef46e4048485a5fe2b81,8d1748a285a9d24abe7a65a159bec37a1791ff69..29c051cc64e77c994769ad132f95313b35e6204d
@@@ -1160,27 -1161,13 +1172,12 @@@ fields_linear_search (tree klass, tree 
      {
        tree decl = fields;
  
-       if (!want_type
-         && TREE_CODE (decl) == FIELD_DECL
+       if (TREE_CODE (decl) == FIELD_DECL
          && ANON_AGGR_TYPE_P (TREE_TYPE (decl)))
        {
-         tree anon = TREE_TYPE (decl);
-         gcc_assert (COMPLETE_TYPE_P (anon));
-         tree temp;
-         
-         if (vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (anon))
-           temp = member_vec_binary_search (member_vec, name);
-         else
-           temp = fields_linear_search (anon, name, want_type);
-         if (temp)
-           {
-             /* Anon members can only contain fields.  */
-             gcc_assert (!STAT_HACK_P (temp) && !DECL_DECLARES_TYPE_P (temp));
-             return temp;
-           }
+         if (tree temp = search_anon_aggr (TREE_TYPE (decl), name, want_type))
+           return temp;
        }
--
        if (DECL_NAME (decl) != name)
        continue;
        
@@@ -1340,41 -1343,70 +1350,50 @@@ get_member_slot (tree klass, tree name
    if (IDENTIFIER_CONV_OP_P (name))
      name = conv_op_identifier;
  
 -  unsigned ix, length = member_vec->length ();
 -  for (ix = 0; ix < length; ix++)
 -    {
 -      tree *slot = &(*member_vec)[ix];
 -      tree fn_name = OVL_NAME (*slot);
 -
 -      if (fn_name == name)
 -      {
 -        /* If we found an existing slot, it must be a function set.
 -           Even with insertion after completion, because those only
 -           happen with artificial fns that have unspellable names.
 -           This means we do not have to deal with the stat hack
 -           either.  */
 -        gcc_checking_assert (OVL_P (*slot));
 -        if (name == conv_op_identifier)
 -          {
 -            gcc_checking_assert (OVL_FUNCTION (*slot) == conv_op_marker);
 -            /* Skip the conv-op marker. */
 -            slot = &OVL_CHAIN (*slot);
 -          }
 -        return slot;
 -      }
 -
 -      if (complete_p && fn_name > name)
 -      break;
 -    }
 -
 -  /* No slot found, add one if the class is complete.  */
 -  if (complete_p)
 +  int ix = get_member_vec_index (member_vec, name);
 +  if (ix < 0)
      {
 -      /* Do exact allocation, as we don't expect to add many.  */
 -      gcc_assert (name != conv_op_identifier);
 -      vec_safe_reserve_exact (member_vec, 1);
 +      /* No slot found.  Create one at -1-IX.  We know in this case
 +         that our caller will succeed in adding the function.  */
 +      ix = -1 - ix;
-       /* Do exact allocation when complete, as we don't expect to add
-        many.  */
++      /* Do exact allocation, when complete, as we don't expect to add many.  */
 +      vec_safe_reserve (member_vec, 1, COMPLETE_TYPE_P (klass));
        CLASSTYPE_MEMBER_VEC (klass) = member_vec;
        member_vec->quick_insert (ix, NULL_TREE);
 -      return &(*member_vec)[ix];
      }
  
 -  return NULL;
 -}
 -
 -/* KLASS is an incomplete class to which we're adding a method NAME.
 -   Add a slot and deal with conv_op marker handling.  */
 -
 -tree *
 -add_member_slot (tree klass, tree name)
 -{
 -  gcc_assert (!COMPLETE_TYPE_P (klass));
 -
 -  vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass);
 -  vec_safe_push (member_vec, NULL_TREE);
 -  CLASSTYPE_MEMBER_VEC (klass) = member_vec;
 +  tree *slot = &(*member_vec)[ix];
  
 -  tree *slot = &member_vec->last ();
 -  if (IDENTIFIER_CONV_OP_P (name))
 +  /* If we found an existing slot, it must be a function set.
 +     Even with insertion after completion, because those only
 +     happen with artificial fns that have unspellable names.
 +     This means we do not have to deal with the stat hack
 +     either.  */
 +  gcc_checking_assert (!*slot || OVL_P (*slot));
 +  if (name == conv_op_identifier)
      {
 -      /* Install the marker prefix.  */
 -      *slot = ovl_make (conv_op_marker, NULL_TREE);
 +      /* Check or install the conv-op marker.  */
 +      if (*slot)
 +      gcc_checking_assert (OVL_FUNCTION (*slot) == conv_op_marker);
 +      else
 +      *slot =  ovl_make (conv_op_marker, NULL_TREE);
 +      /* Skip the conv-op marker. */
        slot = &OVL_CHAIN (*slot);
      }
  
    return slot;
  }
  
++void
++unget_member_slot (tree klass, tree *slot)
++{
++  vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass);
++  gcc_checking_assert (!*slot && member_vec);
++
++  int ix = slot - &(*member_vec)[0];
++  member_vec->ordered_remove (ix);
++}
++
  /* Comparison function to compare two MEMBER_VEC entries by name.
     Because we can have duplicates during insertion of TYPE_FIELDS, we
     do extra checking so deduping doesn't have to deal with so many
index 1fc128070d30b7619dc1f99a1973f6f7abfaa7b0,ae225db3ba5499c25c4c9bc5b629c0477da30277..88bb0818f1fbc71ba54d8af8c542a7a11577231f
@@@ -307,9 -302,11 +302,11 @@@ extern void pop_decl_namespace (void)
  extern void do_namespace_alias (tree, tree);
  extern tree do_class_using_decl (tree, tree);
  extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *);
+ extern tree search_anon_aggr (tree, tree, bool = false);
  extern tree get_class_binding_direct (tree, tree, int type_or_fns = -1);
  extern tree get_class_binding (tree, tree, int type_or_fns = -1);
 -extern tree *find_member_slot (tree klass, tree name);
 -extern tree *add_member_slot (tree klass, tree name);
 +extern tree *get_member_slot (tree klass, tree name);
++extern void unget_member_slot (tree klass, tree *slot);
  extern void resort_type_member_vec (void *, void *,
                                    gt_pointer_operator, void *);
  extern void set_class_bindings (tree, unsigned extra = 0);
diff --cc gcc/cp/pt.c
Simple merge
Simple merge