c++: Private parent access check for using decls [PR19377]
This bug was already mostly fixed by the patch for PR17314. This
patch continues that by ensuring that where a using decl is used,
causing an access failure to a child class because the using decl is
private, the compiler correctly points to the using decl as the
source of the problem.
gcc/cp/ChangeLog:
2021-03-10 Anthony Sharp <anthonysharp15@gmail.com>
* semantics.c (get_class_access_diagnostic_decl): New
function that examines special cases when a parent
class causes a private access failure.
(enforce_access): Slightly modified to call function
above.
gcc/testsuite/ChangeLog:
2021-03-10 Anthony Sharp <anthonysharp15@gmail.com>
* g++.dg/cpp1z/using9.C: New using decl test.
Co-authored-by: Jason Merrill <jason@redhat.com>