// RUN: %clang_cc1 -fsyntax-only -verify %s
// [class.mfct.non-static]p3:
// When an id-expression (5.1) that is not part of a class member
// access syntax (5.2.5) and not used to form a pointer to member
// (5.3.1) is used in the body of a non-static member function of
// class X, if name lookup (3.4.1) resolves the name in the
// id-expression to a non-static non-type member of some class C,
// the id-expression is transformed into a class member access
// expression (5.2.5) using (*this) (9.3.2) as the
// postfix-expression to the left of the . operator. [ Note: if C is
// not X or a base class of X, the class member access expression is
// ill-formed. --end note] Similarly during name lookup, when an
// unqualified-id (5.1) used in the definition of a member function
// for class X resolves to a static member, an enumerator or a
// nested type of class X or of a base class of X, the
// unqualified-id is transformed into a qualified-id (5.1) in which
// the nested-name-specifier names the class of the member function.