Created on 2011-03-28.00:00:00 last changed 149 months ago
Rationale (August, 2011):
This example is not sufficient motivation to revisit the outcome of issue 1043. ((T*)this)->f() can be used to allow lookup in a dependent base.
Consider the following example:
struct A { virtual void f() { /* base */ } }; struct B : virtual A { virtual void f() { /* derived */ } }; template<typename T> struct C : virtual A, T { void g() { this->f(); } }; int main() { C<B> c; c.g(); }
This is reasonable C++03 code that is invalidated by the resolution of issue 1043. In the presence of virtual non-dependent base classes and other dependent base classes, one cannot rely on something being found for real when doing the lookup in the instantiation context (therefore, one cannot know whether a "typename" is actually valid or not, without knowing all dependent base classes).
History | |||
---|---|---|---|
Date | User | Action | Args |
2012-09-24 00:00:00 | admin | set | messages: + msg4027 |
2011-03-28 00:00:00 | admin | create |