summaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-15 21:14:05 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2016-02-15 21:14:05 +0000
commit521a6373b97d37cab16ffe7e280119dd2d3efa02 (patch)
tree2e45a14353f0c3873d716c8fe004c3189dbf32fa /gcc/cp/search.c
parentbbf582248a5839237f0c8230371ce87c807bf768 (diff)
downloadgcc-521a6373b97d37cab16ffe7e280119dd2d3efa02.tar.gz
PR c++/69753
* search.c (any_dependent_bases_p): Split out... * name-lookup.c (do_class_using_decl): ...from here. * call.c (build_new_method_call_1): Don't complain about missing object if there are dependent bases. Tweak error. * tree.c (non_static_member_function_p): Remove. * pt.c (type_dependent_expression_p): A member template of a dependent type is dependent. * cp-tree.h: Adjust. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@233431 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/search.c')
-rw-r--r--gcc/cp/search.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index 79246118915..49f3bc5ed80 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -2842,3 +2842,21 @@ original_binfo (tree binfo, tree here)
return result;
}
+/* True iff TYPE has any dependent bases (and therefore we can't say
+ definitively that another class is not a base of an instantiation of
+ TYPE). */
+
+bool
+any_dependent_bases_p (tree type)
+{
+ if (!type || !CLASS_TYPE_P (type) || !processing_template_decl)
+ return false;
+
+ unsigned i;
+ tree base_binfo;
+ FOR_EACH_VEC_SAFE_ELT (BINFO_BASE_BINFOS (TYPE_BINFO (type)), i, base_binfo)
+ if (BINFO_DEPENDENT_BASE_P (base_binfo))
+ return true;
+
+ return false;
+}