Annex G (informative) Ill-formed, no diagnostic required [ifndr]

G.3 [basic]: Basics [ifndr.basic]

G.3.9[ifndr:class.member.lookup.name.refers.diff.decl]
Specified in: [class.member.lookup]

A name N used in a class S referring to a different declaration when resolved in its context than when re-evaluated in the completed scope of S is ill-formed, no diagnostic required.
[Example 1: struct foo {}; struct bar { foo *m_foo; foo *foo() { return m_foo; } // IFNDR, foo now refers to member function foo() while previously referred to struct foo }; — end example]
[Example 2: struct B { static int f(); }; struct D : public B { using B::f; int g(decltype(f()) x) { return 0; } // IFNDR, decltype(f()) will refer to B​::​f() here but if // moved to the end of D it would refer to D​::​f() static float f(); }; int main() { D d; return d.g(0); } — end example]