diff options
author | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-30 14:50:48 +0000 |
---|---|---|
committer | nathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-06-30 14:50:48 +0000 |
commit | 5a6b88f6da43dd188b97633d7270f84e5cf94042 (patch) | |
tree | fc79ce537be5fa1789fba27c6c91096f4669ec07 /gcc/cp/class.c | |
parent | 2443f8fdb697bcfc50fa7641c9535a1539a1c29a (diff) | |
download | gcc-5a6b88f6da43dd188b97633d7270f84e5cf94042.tar.gz |
* cp-tree.h (lookup_fnfields_1, class_method_index_for_fn): Don't
declare.
(lookup_all_conversions): Declare.
* class.c (get_basefndecls): Use lookup_fnfields_slot.
* decl.c (register_dtor_fn): Use lookup_fnfields_slot.
* decl2.c (check_class_fn): Use lookup_fnfields_slot. Rework
diagnostics.
* pt.c (retrieve_specialization): Use lookup_fnfields_slot.
(check_explicit_specialization): Use lookup_fnfields_slot_nolazy,
lookup_all_conversions.
* search.c (lookup_fnfields_1): Make static.
(lookup_all_conversions): New.
(class_method_index_for_fn): Delete.
* semantics.c (classtype_has_nothrow_assign_or_copy_p): Use
lookup_fnfields_slot.
* g++.dg/concepts/memfun-err.C: Adjust diagnostics.
* g++.dg/cpp0x/decltype9.C: Likewise.
* g++.dg/cpp0x/forw_enum9.C: Likewise.
* g++.dg/lookup/decl1.C: Likewise.
* g++.dg/lookup/extern-c-redecl.C: Likewise.
* g++.dg/other/pr28432.C: Likewise.
* g++.dg/parse/crash12.C: Likewise.
* g++.dg/parse/enum3.C: Likewise.
* g++.dg/parse/operator6.C: Likewise.
* g++.dg/template/crash69.C: Likewise.
* g++.dg/template/error27.C: Likewise.
* g++.dg/template/error28.C: Likewise.
* g++.dg/template/memfriend6.C: Likewise.
* g++.old-deja/g++.mike/err1.C: Likewise.
* g++.old-deja/g++.mike/p811.C: Likewise.
* g++.old-deja/g++.other/crash25.C: Likewise.
* g++.old-deja/g++.other/dtor4.C: Likewise.
* g++.old-deja/g++.pt/t37.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@249843 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 09633b8dd9f..0dca90575c7 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -2966,29 +2966,25 @@ modify_all_vtables (tree t, tree virtuals) static void get_basefndecls (tree name, tree t, vec<tree> *base_fndecls) { - int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); - int i; + bool found_decls = false; /* Find virtual functions in T with the indicated NAME. */ - i = lookup_fnfields_1 (t, name); - bool found_decls = false; - if (i != -1) - for (ovl_iterator iter ((*CLASSTYPE_METHOD_VEC (t))[i]); iter; ++iter) - { - tree method = *iter; + for (ovl_iterator iter (lookup_fnfields_slot (t, name)); iter; ++iter) + { + tree method = *iter; - if (TREE_CODE (method) == FUNCTION_DECL - && DECL_VINDEX (method)) - { - base_fndecls->safe_push (method); - found_decls = true; - } - } + if (TREE_CODE (method) == FUNCTION_DECL && DECL_VINDEX (method)) + { + base_fndecls->safe_push (method); + found_decls = true; + } + } if (found_decls) return; - for (i = 0; i < n_baseclasses; i++) + int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t)); + for (int i = 0; i < n_baseclasses; i++) { tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), i)); get_basefndecls (name, basetype, base_fndecls); |