Commit b4cda6a6 by Jason Merrill Committed by Jason Merrill

Fix template/inherit4.C.

	PR c++/83714
	* search.c (any_dependent_bases_p): Handle null TREE_BINFO.
	* pt.c (instantiation_dependent_scope_ref_p): True if
	any_dependent_bases_p.

From-SVN: r256866
parent 48cdaab9
2018-01-18 Jason Merrill <jason@redhat.com>
PR c++/83714
* search.c (any_dependent_bases_p): Handle null TREE_BINFO.
* pt.c (instantiation_dependent_scope_ref_p): True if
any_dependent_bases_p.
2018-01-18 Paolo Carlini <paolo.carlini@oracle.com>
* cp-tree.h: Fix comment typo (DECL_NON_TRIVIALLY_INITIALIZED_P
......
......@@ -23952,6 +23952,9 @@ instantiation_dependent_scope_ref_p (tree t)
{
if (DECL_P (TREE_OPERAND (t, 1))
&& CLASS_TYPE_P (TREE_OPERAND (t, 0))
/* A dependent base could make a member inaccessible in the current
class. */
&& !any_dependent_bases_p ()
&& accessible_in_template_p (TREE_OPERAND (t, 0),
TREE_OPERAND (t, 1)))
return false;
......
......@@ -2612,6 +2612,13 @@ any_dependent_bases_p (tree type)
if (!type || !CLASS_TYPE_P (type) || !processing_template_decl)
return false;
/* If we haven't set TYPE_BINFO yet, we don't know anything about the bases.
Return false because in this situation we aren't actually looking up names
in the scope of the class, so it doesn't matter whether it has dependent
bases. */
if (!TYPE_BINFO (type))
return false;
unsigned i;
tree base_binfo;
FOR_EACH_VEC_SAFE_ELT (BINFO_BASE_BINFOS (TYPE_BINFO (type)), i, base_binfo)
......
......@@ -22,7 +22,7 @@ public:
static void
c (e *g)
{
g->c ();
g->c (); // { dg-message "incomplete" }
}
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment