aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/search.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-02-15 16:14:05 -0500
committerJason Merrill <jason@gcc.gnu.org>2016-02-15 16:14:05 -0500
commit2bd0a2d6b1b823008e36e1a5833cf520c3807ecc (patch)
tree2e45a14353f0c3873d716c8fe004c3189dbf32fa /gcc/cp/search.c
parentfe69277d6650978749d17d11f488230cee1b2ad9 (diff)
downloadgcc-2bd0a2d6b1b823008e36e1a5833cf520c3807ecc.zip
gcc-2bd0a2d6b1b823008e36e1a5833cf520c3807ecc.tar.gz
gcc-2bd0a2d6b1b823008e36e1a5833cf520c3807ecc.tar.bz2
re PR c++/69753 (bogus: expected primary-expression before ‘>’ token)
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. From-SVN: r233431
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 7924611..49f3bc5 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;
+}