Commit c16b872c by Jason Merrill Committed by Jason Merrill

PR c++/79401 - protected inherited constructor

	* call.c (enforce_access): For inheriting constructor, find a base
	binfo in the path we already have.

From-SVN: r245339
parent 773acd54
2017-02-10 Jason Merrill <jason@redhat.com>
PR c++/79401 - protected inherited constructor
* call.c (enforce_access): For inheriting constructor, find a base
binfo in the path we already have.
2017-02-10 Marek Polacek <polacek@redhat.com> 2017-02-10 Marek Polacek <polacek@redhat.com>
PR c++/79435 PR c++/79435
......
...@@ -6420,7 +6420,8 @@ enforce_access (tree basetype_path, tree decl, tree diag_decl, ...@@ -6420,7 +6420,8 @@ enforce_access (tree basetype_path, tree decl, tree diag_decl,
accessible when used to construct an object of the corresponding base accessible when used to construct an object of the corresponding base
class. */ class. */
decl = strip_inheriting_ctors (decl); decl = strip_inheriting_ctors (decl);
basetype_path = TYPE_BINFO (DECL_CONTEXT (decl)); basetype_path = lookup_base (basetype_path, DECL_CONTEXT (decl),
ba_any, NULL, complain);
} }
if (!accessible_p (basetype_path, decl, true)) if (!accessible_p (basetype_path, decl, true))
......
// PR c++/79401
// { dg-do compile { target c++11 } }
class B
{
protected:
B (int, int);
};
class C : public B
{
protected:
using B::B;
};
class A : public C
{
A (char *);
};
A::A (char *) : C (0, 0)
{
}
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