aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
AgeCommit message (Collapse)AuthorFilesLines
2017-08-29Adjust C++17 class deduction use of DECL_ABSTRACT_ORIGIN.Jason Merrill2-7/+10
* pt.c (build_deduction_guide): Set DECL_ABSTRACT_ORIGIN on the template, not the function. (template_guide_p): Adjust. From-SVN: r251425
2017-08-29Support copying local_specializations.Jason Merrill3-3/+13
* cp-tree.h (enum lss_policy): New. (local_specialization_stack): Add policy parameter to default ctor. * pt.c (local_specialization_stack): Copy local_specializations if lss_copy. From-SVN: r251424
2017-08-29Add immediate potential_constant_expression variants.Jason Merrill7-43/+105
* constexpr.c (potential_constant_expression_1): Add "now" parm. (is_constant_expression, require_constant_expression): New. (is_static_init_expression, is_nondependent_constant_expression) (is_nondependent_static_init_expression): Drop "potential". * except.c (build_must_not_throw_expr): Do type conversion on value-dependent argument. * pt.c, semantics.c, typeck2.c: Use variants without "potential". From-SVN: r251423
2017-08-29Instantiate default arguments/member initializers once.Jason Merrill6-23/+82
* init.c (get_nsdmi): Remember NSDMI instantiations. * parser.c (inject_this_parameter): Be more picky about current_class_ptr. * pt.c (tsubst_copy): Simplify 'this' handling. (tsubst_default_argument): Remember default argument instantiations. Take parameter number. (tsubst_default_arguments): Pass it. * call.c (convert_default_arg): Likewise. From-SVN: r251422
2017-08-29Fix default argument conversion failure and SFINAE.Jason Merrill3-9/+15
* call.c (build_over_call): Check convert_default_arg result for error_mark_node. * parser.c (cp_parser_late_parsing_default_args): Remember error_mark_node. From-SVN: r251421
2017-08-28cp-tree.h (lang_type): Replace sorted_fields vector with bindings map.Nathan Sidwell5-137/+73
* cp-tree.h (lang_type): Replace sorted_fields vector with bindings map. (CLASSTYPE_SORTED_FIELDS): Delete. (CLASSTYPE_BINDINGS): New. * decl.c (finish_enum_value_list): Swap args of insert_late_enum_def_bindings. * name-lookup.c (lookup_field_1): Replace binary search of sorted fields with map->get. (sorted_fields_type_new, count_fields, add_fields_to_record_type, add_enum_fields_to_record_type): Delete. (add_class_member, add_class_members): New. (set_class_bindings): Create map and insert. (insert_late_enum_def_binding): Swap parms. Use add_clasS_member. * ptree.c (cxx_print_type): Delete sorted fields printing. From-SVN: r251388
2017-08-28cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields): Delete.Nathan Sidwell6-124/+131
* cp-tree.h (insert_late_enum_def_into_classtype_sorted_fields): Delete. * name-lookup.h (set_class_bindings, insert_late_enum_def_bindings): Declare. * decl.c (finish_enum_value_list): Adjust for insert_late_enum_def_bindings name change. * class.c (finish_struct_1): Call set_class_bindings. (count_fields, add_fields_to_record_type, add_enum_fields_to_record_type, sorted_fields_type_new, insert_into_classtype_sorted_fields, insert_late_enum_def_into_classtype_sorted_fields): Move to ... * name-lookup.h (count_fields, add_fields_to_record_type, add_enum_fields_to_record_type, sorted_fields_type_new, set_class_bindings, insert_late_enum_def_bindings): ... here. From-SVN: r251387
2017-08-25class.c (method_name_cmp, [...]): Method names can never be NULL.Nathan Sidwell2-19/+9
* class.c (method_name_cmp, resort_method_name_cmp): Method names can never be NULL. From-SVN: r251350
2017-08-25Conversion operators have a special nameNathan Sidwell9-149/+132
Conversion operators have a special name * cp-tree.h (CPTI_CONV_OP_MARKER, CPTI_CONV_OP_IDENTIFIER): New. (conv_op_marker, conv_op_identifier): New. (CLASSTYPE_FIRST_CONVERSION_SLOT): Delete. * decl.c (initialize_predefined_identifiers): Add conv_op_identifier. (cxx_init_decl_processing): Create conv_op_marker. * decl2.c (check_classfn): Lookup conv-ops by name. * class.c (add_method): Use conv_op_identifier & conv_op_marker. (resort_type_method_vec): Don't skip conv-ops. (finish_struct_methods, warn_hidden): Likewise. * name-lookup.h (lookup_all_conversions): Delete. * name-lookup.c (lookup_conversion_operator): Replace with ... (extract_conversion_operator): ... this. (lookup_fnfields_slot_nolazy): Find conv-ops by name. (lookup_all_conversions): Delete. * pt.c (check_explicit_specialization): Find conv-ops by name. * search.c (lookup_conversions_r): Likewise. From-SVN: r251348
2017-08-24Conversion operators kept on single overload setNathan Sidwell4-153/+77
Conversion operators kept on single overload set * class.c (add_method): Keep all conv-ops on one slot. * name-lookup.c (lookup_conversion_operator): Pull the desired conv op out of overload set. * search.c (lookup_conversions_r): Lose template/non-template distinction. (lookup_conversions): Likewise. From-SVN: r251340
2017-08-23cp-tree.h (lookup_field_1, [...]): Move declatations to ...Nathan Sidwell5-257/+269
* cp-tree.h (lookup_field_1, lookup_fnfields_slot, lookup_fnfields_slot_nolazy, lookup_all_conversions): Move declatations to ... * name-lookup.h (lookup_field_1, lookup_fnfields_slot, lookup_fnfields_slot_nolazy, lookup_all_conversions): ... here. * search.c (lookup_conversion_operator, lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot, lookup_all_conversions): Move to ... * name-lookup.c (lookup_conversion_operator, lookup_fnfields_slot_nolazy, lookup_field_1, lookup_fnfields_slot, lookup_all_conversions): ... here. From-SVN: r251319
2017-08-23semantics.c (finish_member_declaration): Move USING_DECL check earlier.Nathan Sidwell2-40/+27
* semantics.c (finish_member_declaration): Move USING_DECL check earlier. Always set C++ linkage. Commonize TYPE_FIELD and template decl list insertion. From-SVN: r251317
2017-08-23cp-tree.h (maybe_version_functions): Declare.Nathan Sidwell4-48/+47
* cp-tree.h (maybe_version_functions): Declare. * decl.c (decls_match): Break function versioning check to separate function. Call it. (maybe_version_functions): Broken out of decls_match. * class.c (add_method): Use maybe_version_functions. From-SVN: r251316
2017-08-23cp-tree.h (print_search_statistics, [...]): Don't declare.Nathan Sidwell4-59/+13
* cp-tree.h (print_search_statistics, reinit_search_statistics): Don't declare. * 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_field_1, lookup_member, lookup_fnfields_slot_nolazy): Remove stat gathering. (print_search_statistics, reinit_search_statistics): Delete. * tree.c (cxx_print_statistics): Don't print search stats. From-SVN: r251315
2017-08-21search.c (lookup_field_r): Remove obsolete code for type-named field in PoD.Nathan Sidwell2-28/+14
* search.c (lookup_field_r): Remove obsolete code for type-named field in PoD. From-SVN: r251243
2017-08-21search.c (lookup_field_1): Assert TYPE is a class and VFIELD isn't special.Nathan Sidwell2-46/+13
* search.c (lookup_field_1): Assert TYPE is a class and VFIELD isn't special. (lookup_field_fuzzy_info::fuzzy_lookup_fnfields): Delete. (lookup_field_fuzzy_r): Adjust. From-SVN: r251241
2017-08-21c-family/c/c++: pass optional vec<location_t> to c-format.cDavid Malcolm3-2/+8
This patch passes along the vec<location_t> of argument locations at a callsite from the C frontend to check_function_arguments and from there to c-format.c, so that we can underline the pertinent argument to mismatched format codes even for tree codes like decls and constants which lack a location_t for their usage sites. This takes e.g.: printf("hello %i %i %i ", foo, bar, baz); ~^ %s to: printf("hello %i %i %i ", foo, bar, baz); ~^ ~~~ %s which is useful for cases where there's more than one variadic argument. gcc/c-family/ChangeLog: * c-common.c (check_function_arguments): Add "arglogs" param; pass it to check_function_format. * c-common.h (check_function_arguments): Add vec<location_t> * param. (check_function_format): Likewise. * c-format.c (struct format_check_context): Add field "arglocs". (check_function_format): Add param "arglocs"; pass it to check_format_info. (check_format_info): Add param "arglocs"; use it to initialize new field of format_ctx. (check_format_arg): Pass format_ctx->arglocs to new param of check_format_info_main. (class argument_parser): New field "arglocs". (argument_parser::argument_parser): Add "arglocs_" param and use it to initialize new field. (argument_parser::check_argument_type): Pass new arglocs field to check_format_types. (check_format_info_main): Add param "arglocs", and use it when constructing arg_parser. (check_format_types): Add param "arglocs"; use it if non-NULL when !EXPR_HAS_LOCATION (cur_param) to get at location information. gcc/c/ChangeLog: * c-typeck.c (build_function_call_vec): Pass arg_loc to call to check_function_arguments. gcc/cp/ChangeLog: * call.c (build_over_call): Pass NULL for new parameter to check_function_arguments. * typeck.c (cp_build_function_call_vec): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/format/diagnostic-ranges.c: Update expected results to show underlining of all pertinent params. * gcc.dg/format/pr72858.c: Likewise. From-SVN: r251238
2017-08-21re PR c++/81899 (ICE: Segmentation fault)Nathan Sidwell2-1/+8
PR c++/81899 * pt.c (instantiate_class_template_1): BOUND_TEMPLATE_TEMPLATE_PARM is never friend-injected. PR c++/81899 * g++.dg/template/pr81899.C: New. From-SVN: r251227
2017-08-18C++: fix ordering of missing std #include suggestion (PR c++/81514)David Malcolm2-19/+29
gcc/cp/ChangeLog: PR c++/81514 * name-lookup.c (maybe_suggest_missing_header): Convert return type from void to bool; return true iff a suggestion was offered. (suggest_alternative_in_explicit_scope): Move call to maybe_suggest_missing_header to before use of best_match, and return true if the former offers a suggestion. gcc/testsuite/ChangeLog: PR c++/81514 * g++.dg/lookup/empty.h: New file. * g++.dg/lookup/missing-std-include-2.C: Replace include of stdio.h with empty.h and a declaration of a "std::sprintf" not based on a built-in. From-SVN: r251186
2017-08-18Add warn_if_not_aligned attributeH.J. Lu3-0/+18
Add warn_if_not_aligned attribute as well as command line options: -Wif-not-aligned and -Wpacked-not-aligned. __attribute__((warn_if_not_aligned(N))) causes compiler to issue a warning if the field in a struct or union is not aligned to N: typedef unsigned long long __u64 __attribute__((aligned(4),warn_if_not_aligned(8))); struct foo { int i1; int i2; __u64 x; }; __u64 is aligned to 4 bytes. But inside struct foo, __u64 should be aligned at 8 bytes. It is used to define struct foo in such a way that struct foo has the same layout and x has the same alignment when __u64 is aligned at either 4 or 8 bytes. Since struct foo is normally aligned to 4 bytes, a warning will be issued: warning: alignment 4 of 'struct foo' is less than 8 Align struct foo to 8 bytes: struct foo { int i1; int i2; __u64 x; } __attribute__((aligned(8))); silences the warning. It also warns the field with misaligned offset: struct foo { int i1; int i2; int i3; __u64 x; } __attribute__((aligned(8))); warning: 'x' offset 12 in 'struct foo' isn't aligned to 8 This warning is controlled by -Wif-not-aligned and is enabled by default. When -Wpacked-not-aligned is used, the same warning is also issued for the field with explicitly specified alignment in a packed struct or union: struct __attribute__ ((aligned (8))) S8 { char a[8]; }; struct __attribute__ ((packed)) S { struct S8 s8; }; warning: alignment 1 of 'struct S' is less than 8 This warning is disabled by default and enabled by -Wall. gcc/ PR c/53037 * print-tree.c (print_node): Support DECL_WARN_IF_NOT_ALIGN and TYPE_WARN_IF_NOT_ALIGN. * stor-layout.c (do_type_align): Merge DECL_WARN_IF_NOT_ALIGN. (handle_warn_if_not_align): New. (place_union_field): Call handle_warn_if_not_align. (place_field): Call handle_warn_if_not_align. Copy TYPE_WARN_IF_NOT_ALIGN. (finish_builtin_struct): Copy TYPE_WARN_IF_NOT_ALIGN. (layout_type): Likewise. * tree-core.h (tree_type_common): Add warn_if_not_align. Set spare to 18. (tree_decl_common): Add warn_if_not_align. * tree.c (build_range_type_1): Copy TYPE_WARN_IF_NOT_ALIGN. * tree.h (TYPE_WARN_IF_NOT_ALIGN): New. (SET_TYPE_WARN_IF_NOT_ALIGN): Likewise. (DECL_WARN_IF_NOT_ALIGN): Likewise. (SET_DECL_WARN_IF_NOT_ALIGN): Likewise. * doc/extend.texi: Document warn_if_not_aligned attribute. * doc/invoke.texi: Document -Wif-not-aligned and -Wpacked-not-aligned. gcc/c-family/ PR c/53037 * c-attribs.c (handle_warn_if_not_aligned_attribute): New. (c_common_attribute_table): Add warn_if_not_aligned. (handle_aligned_attribute): Renamed to ... (common_handle_aligned_attribute): Remove argument, name, and add argument, warn_if_not_aligned. Handle warn_if_not_aligned. (handle_aligned_attribute): New. * c.opt: Add -Wif-not-aligned and -Wpacked-not-aligned. gcc/c/ PR c/53037 * c-decl.c (merge_decls): Also merge DECL_WARN_IF_NOT_ALIGN. (check_bitfield_type_and_width): Don't allow bit-field with warn_if_not_aligned type. gcc/cp/ PR c/53037 * decl.c (duplicate_decls): Also merge DECL_WARN_IF_NOT_ALIGN. * decl2.c (grokbitfield): Don't allow bit-field with warn_if_not_aligned type. gcc/testsuite/ PR c/53037 * c-c++-common/pr53037-5.c: New test. * g++.dg/pr53037-1.C: Likewise. * g++.dg/pr53037-2.C: Likewise. * g++.dg/pr53037-3.C: Likewise. * g++.dg/pr53037-4.C: Likewise. * gcc.dg/pr53037-1.c: Likewise. * gcc.dg/pr53037-2.c: Likewise. * gcc.dg/pr53037-3.c: Likewise. * gcc.dg/pr53037-4.c: Likewise. From-SVN: r251180
2017-08-17cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment.Nathan Sidwell3-24/+17
* cp-tree.def (TEMPLATE_TEMPLATE_PARM): Remove stale comment. * cp-tree.h (ENUM_TEMPLATE_INFO): Delete. (TYPE_TEMPLATE_INFO): Simplify. (SET_TYPE_TEMPLATE_INFO): Simplify. From-SVN: r251159
2017-08-17lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs don't need ↵Nathan Sidwell3-11/+14
lang_type. * lex.c (maybe_add_lang_type_raw): BOUND_TEMPLATE_TEMPLATE_PARMs don't need lang_type. (cxx_make_type): Use maybe_add_lang_type_raw return value. * mangle.c (CLASSTYPE_TEMPLATE_ID_P): Don't rely on TYPE_LANG_SPECIFIC. From-SVN: r251154
2017-08-17cp-tree.h (struct lang_type): Remove template_info field.Nathan Sidwell2-6/+13
* cp-tree.h (struct lang_type): Remove template_info field. (CLASSTYPE_TEMPLATE_INFO): Use TYPE_LANG_SLOT_1. (TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO): Likewise. From-SVN: r251148
2017-08-14PR c/81117 - Improve buffer overflow checking in strncpy - part 1Martin Sebor2-1/+12
gcc/ChangeLog: PR c/81117 * tree-diagnostic.c (default_tree_printer): Handle %G. * gimple-pretty-print.h (percent_G_format): Declare new function. * gimple-pretty-print.c (percent_G_format): Define. * tree-pretty-print.c (percent_K_format): Add argument. gcc/c/ChangeLog: PR c/81117 * c-objc-common.c (c_objc_common_init): Handle 'G'. gcc/c-family/ChangeLog: PR c/81117 * c-format.h (T89_G): New macro. * c-format.c (local_gcall_ptr_node): New variable. (init_dynamic_diag_info): Initialize it. gcc/cp/ChangeLog: PR c/81117 * error.c (cp_printer): Handle 'G'. gcc/testsuite/ChangeLog: PR c/81117 * gcc.dg/format/gcc_diag-10.c: Exercise %G. From-SVN: r251098
2017-08-11Introduce TARGET_SUPPORTS_ALIASESMartin Liska3-17/+23
2017-08-11 Martin Liska <mliska@suse.cz> * c-opts.c (c_common_post_options): Replace ASM_OUTPUT_DEF with TARGET_SUPPORTS_ALIASES. 2017-08-11 Martin Liska <mliska@suse.cz> * asan.c (asan_protect_global): Replace ASM_OUTPUT_DEF with TARGET_SUPPORTS_ALIASES. * cgraph.c (cgraph_node::create_same_body_alias): Likewise. * ipa-visibility.c (can_replace_by_local_alias): Likewise. (optimize_weakref): Likewise. * symtab.c (symtab_node::noninterposable_alias): Likewise. * varpool.c (varpool_node::create_extra_name_alias): Likewise. * defaults.h: Introduce TARGET_SUPPORTS_ALIASES. 2017-08-11 Martin Liska <mliska@suse.cz> * decl2.c (get_tls_init_fn): Replace ASM_OUTPUT_DEF with TARGET_SUPPORTS_ALIASES. (handle_tls_init): Likewise. (note_mangling_alias): Likewise. Remove ATTRIBUTE_UNUSED for both arguments. * optimize.c (can_alias_cdtor): Likewise. From-SVN: r251048
2017-08-11PR c++/81671 - nullptr_t template parameterJason Merrill2-1/+6
* pt.c (convert_nontype_argument): Fix nullptr_t check. From-SVN: r251046
2017-08-10PR c++/81359 - Unparsed NSDMI error from SFINAE context.Jason Merrill2-4/+14
* method.c (synthesized_method_walk): Don't diagnose lack of operator delete. From-SVN: r251036
2017-08-10PR c++/80452 - Core 1579, implicit move semantics on return/throwJason Merrill5-19/+70
* cp-tree.h (LOOKUP_PREFER_RVALUE): Now means that we've already tentatively changed the lvalue to an rvalue. * call.c (reference_binding): Remove LOOKUP_PREFER_RVALUE handling. (build_over_call): If LOOKUP_PREFER_RVALUE, check that the first parameter is an rvalue reference. * except.c (build_throw): Do maybe-rvalue overload resolution twice. * typeck.c (check_return_expr): Likewise. From-SVN: r251035
2017-08-10C/C++: show pertinent open token when missing a close tokenDavid Malcolm2-290/+632
gcc/c/ChangeLog: * c-parser.c (c_parser_error): Rename to... (c_parser_error_richloc): ...this, making static, and adding "richloc" parameter, passing it to the c_parse_error call, rather than calling c_parser_set_source_position_from_token. (c_parser_error): Reintroduce, reimplementing in terms of the above, converting return type from void to bool. (class token_pair): New class. (struct matching_paren_traits): New struct. (matching_parens): New typedef. (struct matching_brace_traits): New struct. (matching_braces): New typedef. (get_matching_symbol): New function. (c_parser_require): Add param MATCHING_LOCATION, using it to highlight matching "opening" tokens for missing "closing" tokens. (c_parser_skip_until_found): Likewise. (c_parser_static_assert_declaration_no_semi): Convert explicit parsing of CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of class matching_parens, so that the pertinent open parenthesis is highlighted when there are problems locating the close parenthesis. (c_parser_struct_or_union_specifier): Likewise. (c_parser_typeof_specifier): Likewise. (c_parser_alignas_specifier): Likewise. (c_parser_simple_asm_expr): Likewise. (c_parser_braced_init): Likewise, for matching_braces. (c_parser_paren_condition): Likewise, for matching_parens. (c_parser_switch_statement): Likewise. (c_parser_for_statement): Likewise. (c_parser_asm_statement): Likewise. (c_parser_asm_operands): Likewise. (c_parser_cast_expression): Likewise. (c_parser_sizeof_expression): Likewise. (c_parser_alignof_expression): Likewise. (c_parser_generic_selection): Likewise. (c_parser_postfix_expression): Likewise for cases RID_VA_ARG, RID_OFFSETOF, RID_TYPES_COMPATIBLE_P, RID_AT_SELECTOR, RID_AT_PROTOCOL, RID_AT_ENCODE, reindenting as necessary. In case CPP_OPEN_PAREN, pass loc_open_paren to the c_parser_skip_until_found call. (c_parser_objc_class_definition): Use class matching_parens as above. (c_parser_objc_method_decl): Likewise. (c_parser_objc_try_catch_finally_statement): Likewise. (c_parser_objc_synchronized_statement): Likewise. (c_parser_objc_at_property_declaration): Likewise. (c_parser_oacc_wait_list): Likewise. (c_parser_omp_var_list_parens): Likewise. (c_parser_omp_clause_collapse): Likewise. (c_parser_omp_clause_default): Likewise. (c_parser_omp_clause_if): Likewise. (c_parser_omp_clause_num_threads): Likewise. (c_parser_omp_clause_num_tasks): Likewise. (c_parser_omp_clause_grainsize): Likewise. (c_parser_omp_clause_priority): Likewise. (c_parser_omp_clause_hint): Likewise. (c_parser_omp_clause_defaultmap): Likewise. (c_parser_oacc_single_int_clause): Likewise. (c_parser_omp_clause_ordered): Likewise. (c_parser_omp_clause_reduction): Likewise. (c_parser_omp_clause_schedule): Likewise. (c_parser_omp_clause_num_teams): Likewise. (c_parser_omp_clause_thread_limit): Likewise. (c_parser_omp_clause_aligned): Likewise. (c_parser_omp_clause_linear): Likewise. (c_parser_omp_clause_safelen): Likewise. (c_parser_omp_clause_simdlen): Likewise. (c_parser_omp_clause_depend): Likewise. (c_parser_omp_clause_map): Likewise. (c_parser_omp_clause_device): Likewise. (c_parser_omp_clause_dist_schedule): Likewise. (c_parser_omp_clause_proc_bind): Likewise. (c_parser_omp_clause_uniform): Likewise. (c_parser_omp_for_loop): Likewise. (c_parser_cilk_clause_vectorlength): Likewise. (c_parser_cilk_clause_linear): Likewise. (c_parser_transaction_expression): Likewise. * c-parser.h (c_parser_require): Add param matching_location with default UNKNOWN_LOCATION. (c_parser_error): Convert return type from void to bool. (c_parser_skip_until_found): Add param matching_location with default UNKNOWN_LOCATION. gcc/c-family/ChangeLog: * c-common.c (c_parse_error): Add rich_location * param, using it rather implicitly using input_location. * c-common.h (c_parse_error): Add rich_location * param. gcc/cp/ChangeLog: * parser.c (cp_parser_error): Update for new param to c_parse_error. (class token_pair): New class. (struct matching_paren_traits): New struct. (matching_parens): New typedef. (struct matching_brace_traits): New struct. (matching_braces): New typedef. (cp_parser_statement_expr): Convert explicit parsing of CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use of class matching_parens, so that the pertinent open parenthesis is highlighted when there are problems locating the close parenthesis. (cp_parser_primary_expression): Likewise. (cp_parser_compound_literal_p): Remove consumption of opening paren. (cp_parser_postfix_expression): Convert explicit parsing of CPP_OPEN_PAREN and CPP_CLOSE_PAREN to use matching parens, as above. Use it to consume the opening paren previously consumed by cp_parser_compound_literal_p. (cp_parser_parenthesized_expression_list): Likewise. (cp_parser_unary_expression): Likewise. (cp_parser_new_expression): Likewise. (cp_parser_cast_expression): Likewise. (cp_parser_builtin_offsetof): Likewise. (cp_parser_trait_expr): Likewise. (cp_parser_lambda_declarator_opt): Likewise. (cp_parser_lambda_body): Likewise, for matching_braces. (cp_parser_compound_statement): Likewise. (cp_parser_selection_statement): Likewise, for matching_parens. (cp_parser_iteration_statement): Likewise. (cp_parser_already_scoped_statement): Likewise, for matching_braces. (cp_parser_linkage_specification): Likewise. (cp_parser_static_assert): Likewise, for matching_parens. (cp_parser_decltype): Likewise. (cp_parser_operator): Likewise. (cp_parser_enum_specifier): Likewise. (cp_parser_namespace_definition): Likewise. (cp_parser_direct_declarator): Likewise. (cp_parser_braced_list): Likewise. (cp_parser_class_specifier_1): Likewise, for matching_braces. (cp_parser_constant_initializer): Likewise. (cp_parser_noexcept_specification_opt): Likewise, for matching_parens. (cp_parser_exception_specification_opt): Likewise. (cp_parser_handler): Likewise. (cp_parser_asm_specification_opt): Likewise. (cp_parser_asm_operand_list): Likewise. (cp_parser_gnu_attributes_opt): Likewise. (cp_parser_std_attribute_spec): Likewise. (cp_parser_requirement_parameter_list): Likewise. (cp_parser_requirement_body): Likewise, for matching_braces. (cp_parser_compound_requirement): Likewise. (cp_parser_template_introduction): Likewise. (cp_parser_sizeof_pack): Likewise, for matching_parens. (cp_parser_sizeof_operand): Likewise; use it to consume the opening paren previously consumed by cp_parser_compound_literal_p. (get_matching_symbol): New function. (cp_parser_required_error): Add param "matching_location". Remove calls to cp_parser_error, instead setting a non-NULL gmsgid, and handling it if set by calling c_parse_error, potentially with a secondary location if matching_location was set. (cp_parser_require): Add param "matching_location", with a default value of UNKNOWN_LOCATION. (cp_parser_require_keyword): Update for new param of cp_parser_required_error. (cp_parser_objc_encode_expression): Update to class matching_parens as above. (cp_parser_objc_defs_expression): Likewise. (cp_parser_objc_protocol_expression): Likewise. (cp_parser_objc_selector_expression): Likewise. (cp_parser_objc_typename): Likewise. (cp_parser_objc_superclass_or_category): Likewise. (cp_parser_objc_try_catch_finally_statement): Likewise. (cp_parser_objc_synchronized_statement): Likewise. (cp_parser_objc_at_property_declaration): Likewise. (cp_parser_oacc_single_int_clause): Likewise. (cp_parser_oacc_shape_clause): Likewise. (cp_parser_omp_clause_collapse): Likewise. (cp_parser_omp_clause_default): Likewise. (cp_parser_omp_clause_final): Likewise. (cp_parser_omp_clause_if): Likewise. (cp_parser_omp_clause_num_threads): Likewise. (cp_parser_omp_clause_num_tasks): Likewise. (cp_parser_omp_clause_grainsize): Likewise. (cp_parser_omp_clause_priority): Likewise. (cp_parser_omp_clause_hint): Likewise. (cp_parser_omp_clause_defaultmap): Likewise. (cp_parser_omp_clause_ordered): Likewise. (cp_parser_omp_clause_schedule): Likewise. (cp_parser_omp_clause_num_teams): Likewise. (cp_parser_omp_clause_thread_limit): Likewise. (cp_parser_omp_clause_aligned): Likewise. (cp_parser_omp_clause_linear): Likewise. (cp_parser_omp_clause_safelen): Likewise. (cp_parser_omp_clause_simdlen): Likewise. (cp_parser_omp_clause_depend): Likewise. (cp_parser_omp_clause_device): Likewise. (cp_parser_omp_clause_dist_schedule): Likewise. (cp_parser_oacc_clause_async): Likewise. (cp_parser_omp_critical): Likewise. (cp_parser_omp_for_loop): Likewise. (cp_parser_omp_sections_scope): Likewise. (cp_parser_omp_declare_reduction_exprs): Likewise. Update for new param to cp_parser_required_error. (cp_parser_oacc_routine): Likewise. (cp_parser_transaction_expression): Likewise. (cp_parser_cilk_simd_vectorlength): Likewise. gcc/testsuite/ChangeLog: * c-c++-common/missing-close-symbol.c: New test case. * c-c++-common/missing-symbol.c: New test case. * gcc.dg/unclosed-init.c: New test case. * g++.dg/diagnostic/unclosed-extern-c.C: New test case. * g++.dg/diagnostic/unclosed-function.C: New test case. * g++.dg/diagnostic/unclosed-namespace.C: New test case. * g++.dg/diagnostic/unclosed-struct.C: New test case. * g++.dg/parse/pragma2.C: Update to reflect movement of the "expected identifier" error. From-SVN: r251026
2017-08-09PR c++/81525 - wrong constant value with generic lambdaJason Merrill2-0/+16
* pt.c (tsubst_decl) [VAR_DECL]: Avoid clobbering auto. (tsubst_copy) [VAR_DECL]: Handle auto. From-SVN: r250999
2017-08-09PR c++/81359 - Unparsed NSDMI error from SFINAE context.Jason Merrill11-53/+105
* init.c (get_nsdmi): Add complain parm. * typeck2.c (digest_nsdmi_init): Add complain parm. (process_init_constructor_record): Pass complain to get_nsdmi. * pt.c (maybe_instantiate_noexcept): Add complain parm, return bool. * method.c (get_defaulted_eh_spec): Add complain parm. Pass it into synthesized_method_walk. (synthesized_method_walk): Adjust. (walk_field_subobs): Pass complain to get_nsdmi. (defaulted_late_check): Skip other checks if deleted. * decl2.c (mark_used): Pass complain to maybe_instantiate_noexcept. * call.c (build_aggr_conv): Pass complain to get_nsdmi. * parser.c (defarg_location): New. * error.c (location_of): Use it. From-SVN: r250994
2017-08-09Boolify some parameters.Marek Polacek3-3/+9
From-SVN: r250986
2017-08-08re PR c++/81607 (Conditional operator: "type mismatch in shift expression" ↵Marek Polacek2-3/+10
error) PR c++/81607 * cp-gimplify.c (cp_fold): If folding exposed a branch of a COND_EXPR, convert it to the original type of the COND_EXPR, if they differ. * g++.dg/other/bitfield6.C: New test. From-SVN: r250948
2017-08-08trans.c: Include header files.Martin Liska9-0/+27
. 2017-08-08 Martin Liska <mliska@suse.cz> * gcc-interface/trans.c: Include header files. 2017-08-08 Martin Liska <mliska@suse.cz> * objc-gnu-runtime-abi-01.c: Include header files. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * asan.c: Include header files. * attribs.c (build_decl_attribute_variant): New function moved from tree.[ch]. (build_type_attribute_qual_variant): Likewise. (cmp_attrib_identifiers): Likewise. (simple_cst_list_equal): Likewise. (omp_declare_simd_clauses_equal): Likewise. (attribute_value_equal): Likewise. (comp_type_attributes): Likewise. (build_type_attribute_variant): Likewise. (lookup_ident_attribute): Likewise. (remove_attribute): Likewise. (merge_attributes): Likewise. (merge_type_attributes): Likewise. (merge_decl_attributes): Likewise. (merge_dllimport_decl_attributes): Likewise. (handle_dll_attribute): Likewise. (attribute_list_equal): Likewise. (attribute_list_contained): Likewise. * attribs.h (lookup_attribute): New function moved from tree.[ch]. (lookup_attribute_by_prefix): Likewise. * bb-reorder.c: Include header files. * builtins.c: Likewise. * calls.c: Likewise. * cfgexpand.c: Likewise. * cgraph.c: Likewise. * cgraphunit.c: Likewise. * convert.c: Likewise. * dwarf2out.c: Likewise. * final.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimplify.c: Likewise. * hsa-common.c: Likewise. * hsa-gen.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-fnsummary.c: Likewise. * ipa-inline.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * lto-cgraph.c: Likewise. * omp-expand.c: Likewise. * omp-general.c: Likewise. * omp-low.c: Likewise. * omp-offload.c: Likewise. * omp-simd-clone.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * predict.c: Likewise. * sancov.c: Likewise. * sanopt.c: Likewise. * symtab.c: Likewise. * toplev.c: Likewise. * trans-mem.c: Likewise. * tree-chkp.c: Likewise. * tree-eh.c: Likewise. * tree-into-ssa.c: Likewise. * tree-object-size.c: Likewise. * tree-parloops.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-streamer-in.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * tree.c: Remove functions moved to attribs.[ch]. * tree.h: Likewise. * config/aarch64/aarch64.c: Add attrs.h header file. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/powerpcspe/powerpcspe.c: Likewise. * config/riscv/riscv.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/xtensa/xtensa.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * call.c: Include header files. * cp-gimplify.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * init.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * lto-lang.c: Include header files. * lto-symtab.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-convert.c: Include header files. * c-typeck.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * c-ada-spec.c: Include header files. * c-ubsan.c: Likewise. * c-warn.c: Likewise. 2017-08-08 Martin Liska <mliska@suse.cz> * trans-types.c: Include header files. From-SVN: r250946
2017-08-07Canonicalize names of attributes.Martin Liska3-1/+13
2017-08-07 Martin Liska <mliska@suse.cz> * attribs.h (canonicalize_attr_name): New function. (cmp_attribs): Move from c-format.c and adjusted. (is_attribute_p): Moved from tree.h. * tree-inline.c: Add new includes. * tree.c (cmp_attrib_identifiers): Use cmp_attribs. (private_is_attribute_p): Remove. (private_lookup_attribute): Likewise. (private_lookup_attribute_by_prefix): Simplify. (remove_attribute): Use is_attribute_p. * tree.h: Remove removed declarations. 2017-08-07 Martin Liska <mliska@suse.cz> * array-notation-common.c: Add new includes. * c-format.c( handle_format_attribute): Canonicalize a format function name. * c-lex.c (c_common_has_attribute): Canonicalize name of an attribute. * c-pretty-print.c: Add new include. 2017-08-07 Martin Liska <mliska@suse.cz> * parser.c (cp_parser_gnu_attribute_list): Canonicalize name of an attribute. (cp_parser_std_attribute): Likewise. * tree.c: Add new include. 2017-08-07 Martin Liska <mliska@suse.cz> * c-parser.c (c_parser_attributes): Canonicalize name of an attribute. 2017-08-07 Martin Liska <mliska@suse.cz> * go-gcc.cc (Gcc_backend::function): Look up for no_split_stack and not __no_split_stack__. 2017-08-07 Martin Liska <mliska@suse.cz> * g++.dg/cpp0x/pr65558.C: Update scanned pattern. * gcc.dg/parm-impl-decl-1.c: Likewise. * gcc.dg/parm-impl-decl-3.c: Likewise. * gcc.dg/Wattributes-5.c: New test. From-SVN: r250911
2017-08-04re PR c++/79790 ([C++17] ICE class template argument deduction failed)Paolo Carlini2-5/+14
/cp 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/79790 * pt.c (do_class_deduction): Handle the case of no viable implicit deduction guides; simplify the code generating implicit deduction guides. /testsuite 2017-08-04 Paolo Carlini <paolo.carlini@oracle.com> PR c++/79790 * g++.dg/cpp1z/class-deduction42.C: New. From-SVN: r250882
2017-08-03re PR c++/71440 (ICE on invalid C++ code in instantiate_type, at ↵Paolo Carlini2-3/+9
cp/class.c:8247) /cp 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71440 * typeck.c (build_x_unary_op): Avoid pretty-printing constructor / destructor as expressions. /testsuite 2017-08-03 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71440 * g++.dg/template/crash127.C: New. From-SVN: r250848
2017-08-02re PR c++/81640 (ICE in lookup_fnfields_slot_nolazy w/ ↵Jakub Jelinek2-1/+7
-Wshadow=compatible-local) PR c++/81640 * call.c (build_user_type_conversion_1): Only call lookup_fnfields_slot if totype is CLASS_TYPE_P. * g++.dg/warn/Wshadow-compatible-local-2.C: New test. From-SVN: r250816
2017-08-01* decl.c (declare_global_var): Set DECL_CONTEXT.Jason Merrill2-0/+5
From-SVN: r250786
2017-07-31Recover GOTO predictor.Jan Hubicka4-0/+14
2017-07-31 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> * c-typeck.c (c_finish_goto_label): Build gimple predict stament. 2017-07-31 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> * predict.def: Remove old comment and adjust probability. * gimplify.c (should_warn_for_implicit_fallthrough): Ignore PREDICT statements. 2017-07-31 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> * gcc.dg/predict-15.c: New test. * gcc.dg/tree-ssa/vrp24.c: Update scanned pattern. 2017-07-31 Jan Hubicka <hubicka@ucw.cz> Martin Liska <mliska@suse.cz> * pt.c (tsubst_copy): Copy PREDICT_EXPR. * semantics.c (finish_goto_stmt): Build gimple predict stament. * constexpr.c (potential_constant_expression_1): Handle PREDICT_EXPR. Co-Authored-By: Martin Liska <mliska@suse.cz> From-SVN: r250737
2017-07-31Do UBSAN sanitization just when current_function_decl != NULL_TREE (PR ↵Martin Liska6-3/+20
sanitize/81530). 2017-07-31 Martin Liska <mliska@suse.cz> PR sanitize/81530 * cp-gimplify.c (cp_genericize): Guard condition with flag_sanitize_p also with current_function_decl non-null equality. * cp-ubsan.c (cp_ubsan_instrument_vptr_p): Likewise. * decl.c (compute_array_index_type): Likewise. * init.c (finish_length_check): Likewise. * typeck.c (cp_build_binary_op): Likewise. 2017-07-31 Martin Liska <mliska@suse.cz> PR sanitize/81530 * c-convert.c (convert): Guard condition with flag_sanitize_p also with current_function_decl non-null equality. * c-decl.c (grokdeclarator): Likewise. * c-typeck.c (build_binary_op): Likewise. 2017-07-31 Martin Liska <mliska@suse.cz> PR sanitize/81530 * convert.c (convert_to_integer_1): Guard condition with flag_sanitize_p also with current_function_decl non-null equality. 2017-07-31 Martin Liska <mliska@suse.cz> PR sanitize/81530 * c-ubsan.c (ubsan_maybe_instrument_array_ref): Guard condition with flag_sanitize_p also with current_function_decl non-null equality. (ubsan_maybe_instrument_reference_or_call): Likewise. 2017-07-31 Martin Liska <mliska@suse.cz> PR sanitize/81530 * g++.dg/ubsan/pr81530.C: New test. From-SVN: r250730
2017-07-29debug.h (struct gcc_debug_hooks): Add IMPLICIT argument to ↵Jakub Jelinek3-8/+29
imported_module_or_decl hook. * debug.h (struct gcc_debug_hooks): Add IMPLICIT argument to imported_module_or_decl hook. (debug_nothing_tree_tree_tree_bool): Remove. (debug_nothing_tree_tree_tree_bool_bool): New declaration. * debug.c (do_nothing_debug_hooks): Use debug_nothing_tree_tree_tree_bool_bool instead of debug_nothing_tree_tree_tree_bool. * vmsdbgout.c (vmsdbg_debug_hooks): Likewise. * dbxout.c (dbx_debug_hooks, xcoff_debug_hooks): Likewise. * sdbout.c (sdb_debug_hooks): Likewise. * dwarf2out.c (dwarf2_lineno_debug_hooks): Likewise. (gen_namespace_die): Add DW_AT_export_symbols attribute if langhook wants it. (dwarf2out_imported_module_or_decl): Add IMPLICIT argument, if true, -gdwarf-5 and decl will have DW_AT_export_symbols attribute, don't add anything. cp/ * cp-objcp-common.c (cp_decl_dwarf_attribute): Handle DW_AT_export_symbols. * name-lookup.c (emit_debug_info_using_namespace): Add IMPLICIT argument, pass it through to the debug hook. (finish_namespace_using_directive): Adjust emit_debug_info_using_namespace caller. (push_namespace): Likewise. Call it after setting DECL_NAMESPACE_INLINE_P. (cp_emit_debug_info_for_using): Pass false as new argument to the imported_module_or_decl debug hook. fortran/ * trans-decl.c (gfc_trans_use_stmts): Pass false as new argument to the imported_module_or_decl debug hook. ada/ * gcc-interface/utils.c (gnat_write_global_declarations): Pass false as new argument to the imported_module_or_decl debug hook. testsuite/ * g++.dg/debug/dwarf2/inline-ns-1.C: New test. * g++.dg/debug/dwarf2/inline-ns-2.C: New test. From-SVN: r250713
2017-07-29use c++ instead of _stat for copy_node_statTrevor Saunders2-2/+7
gcc/cp/ChangeLog: 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * lex.c (copy_decl): Adjust. (copy_type): Likewise. gcc/ChangeLog: 2017-07-28 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * tree.c (copy_node_stat): Rename to copy_node. (build_distinct_type_copy): Adjust. * tree.h (copy_node_stat): Adjust prototype. (copy_node): Remove macro. From-SVN: r250695
2017-07-26re PR c++/71570 (ICE on invalid variable capture in ↵Paolo Carlini2-1/+10
cxx_incomplete_type_diagnostic, at cp/typeck2.c:55) /cp 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71570 * lambda.c (add_capture): Early return if we cannot capture by reference. /testsuite 2017-07-26 Paolo Carlini <paolo.carlini@oracle.com> PR c++/71570 * g++.dg/cpp0x/lambda/lambda-ice17.C: New. From-SVN: r250591
2017-07-26P0702R1 - List deduction of vector.Jason Merrill2-0/+24
* pt.c (do_class_deduction): Special-case deduction from a single element of related type. From-SVN: r250584
2017-07-26PR c++/67054 - Inherited ctor with non-default-constructible membersLeonid Koppel2-1/+7
PR c++/67054 - Inherited ctor with non-default-constructible members * method.c (walk_field_subobs) Consider member initializers (NSDMIs) when deducing an inheriting constructor. From-SVN: r250583
2017-07-21search.c (lookup_conversion_operator): Return overloads.Nathan Sidwell2-69/+44
* search.c (lookup_conversion_operator): Return overloads. (lookup_fnfields_idx_nolazy): Absorb into ... (lookup_fnfields_slot_nolaxy): ... here. (lookup_fnfields_1): Absorb into ... (lookup_fnfields_slot): ... here. From-SVN: r250440
2017-07-21Remove special CDtor METHOD_VEC slots.Nathan Sidwell5-97/+57
* cp-tree.h (CLASSTYPE_CONSTRUCTOR_SLOT, CLASSTYPE_DESTRUCTOR_SLOT): Delete. (CLASSTYPE_CONSTRUCTORS): Use lookup_fnfields_slot_nolazy. (CLASSTYPE_DESTRUCTOR): Likewise. * class (add_method): Don't use special cdtor slots. * search.c (lookup_fnfields_idx_nolazy): Likewise. (look_for_overrides_here): Use lookup_fnfields_slot. * semantics (classtype_has_nothrow_assign_or_copy_p): Likewise. From-SVN: r250437
2017-07-21call.c (add_candidates): Move decls to initialization.Nathan Sidwell2-20/+14
* call.c (add_candidates): Move decls to initialization. Don't use !!. From-SVN: r250434
2017-07-21Remove TYPE_METHODS.Nathan Sidwell9-192/+197
gcc/ Remove TYPE_METHODS. * tree.h (TYPE_METHODS): Delete. * dwarf2out.c (gen_member_die): Member fns are on TYPE_FIELDS. * dbxout.c (dbxout_type_fields): Ignore FUNCTION_DECLs. (dbxout_type_methods): Scan TYPE_FIELDS. (dbxout_type): Don't check TYPE_METHODS here. * 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. * 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. gcc/cp/ Remove TYPE_METHODS. * 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/c-family/ Remove TYPE_METHODS. * 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/objc/ Remove TYPE_METHODS. * objc-runtime-shared-support.c (build_ivar_list_initializer): Don't presume first item is a FIELD_DECL. gcc/testsuite/ * g++.dg/ext/anon-struct6.C: Adjust diag. * g++.old-deja/g++.other/anon4.C: Adjust diag. libcc1/ Remove TYPE_METHODS. * libcp1plugin.cc (plugin_build_decl): Member fns are on TYPE_FIELDS. From-SVN: r250413