Yes, this is a mistake.
I can play it even easier without ctor-initialiser:
template <typename T> struct Base { }; struct Derived : Base<int> { Base* ptr; }; int main() { Derived d; }
and
[C++11: 14.6.1/4]: search that finds a name with the introduced class (10.2) can lead to ambiguity in some cases (for example, if it is found in several base classes). If all the names of the entered classes that are found are related to specializations of the same class template, and if the name is used as the template name, the link refers to the class template itself, and not to its specialization, and is not ambiguous. [Example:
template <class T> struct Base { }; template <class T> struct Derived: Base<int>, Base<char> { typename Derived::Base b;
-end example]
Note that almost the equivalent of my unambiguous use is OK. Ok, so Derived is a class template here, not in my example, so this is not exactly the same example. But now I am pleased that fully 14.6.1 makes my code legal.
Turns out he was raised as a GCC bug 45515 & dagger; but since she had her head fixed at a time when there were very few details on it.
& dagger; Thanks BoBTFish !
Lightness races in orbit
source share