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 structfoo};
— end example]
[Example 2: struct B {staticint f();
};
struct D :public B {using B::f;
int g(decltype(f()) x){return0;
}// IFNDR, decltype(f()) will refer to B::f() here but if// moved to the end of D it would refer to D::f()staticfloat f();
};
int main(){
D d;
return d.g(0);
} — end example]