llvm-project/clang/test/CXX/class.access
John McCall 5149fbfd56 Only suppress instance context if a member is actually
accessible in its declaring class;  otherwise we might
fail to apply [class.protected] when considering
accessibility in derived classes.

Noticed by inspection; <rdar://13270329>.

I had an existing test wrong.  Here's why it's wrong:

Follow the rules (and notation) of [class.access]p5.
The naming class (N) is B and the context (R) is D::getX.
- 'x' as a member of B is protected, but R does not occur
  in a member or friend of a class derived from B.
- There does exist a base class of B, A, which is accessible
  from R, and 'x' is accessible at R when named in A because
  'x' as a member of A is protected and R occurs in a member
  of a class, D, that is derived from A;  however, by
  [class.protected], the class of the object expression must
  be equal to or derived from that class, and A does not
  derive from D.

llvm-svn: 175858
2013-02-22 03:52:55 +00:00
..
class.access.base When we complain about a member being inaccessible due to a constraint 2010-05-28 04:34:55 +00:00
class.access.dcl A bug I've introduced in STDIN handling surfaced a few broken tests, fix them. 2010-06-25 12:48:07 +00:00
class.access.nest
class.friend Don't check whether a friend declaration is correctly formed when instantiating, 2013-02-06 05:59:33 +00:00
class.protected Only suppress instance context if a member is actually 2013-02-22 03:52:55 +00:00
p4.cpp Fix several problems with protected access control: 2012-04-07 03:04:20 +00:00
p6.cpp Modify how the -verify flag works. Currently, the verification string and 2011-12-15 00:38:15 +00:00