From bff8b385e997a85cce62031c80bac1b431659fcd Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 25 Aug 2017 11:37:10 +0000 Subject: Conversion operators have a special name 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 --- gcc/cp/search.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gcc/cp/search.c') diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 31f4dd6..266d8dd 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -2370,12 +2370,8 @@ lookup_conversions_r (tree binfo, int virtual_depth, int virtualness, virtual_depth++; /* First, locate the unhidden ones at this level. */ - vec *method_vec = CLASSTYPE_METHOD_VEC (BINFO_TYPE (binfo)); - tree conv = NULL_TREE; - vec_safe_iterate (method_vec, CLASSTYPE_FIRST_CONVERSION_SLOT, &conv); - if (conv && !DECL_CONV_FN_P (OVL_FIRST (conv))) - conv = NULL_TREE; - + tree conv = lookup_fnfields_slot_nolazy (BINFO_TYPE (binfo), + conv_op_identifier); for (ovl_iterator iter (conv); iter; ++iter) { tree fn = *iter; -- cgit v1.1