This is a re-based version of Martin's patch from the bug report with few minor changes by me.
I don't think that we have to implement this feature identically to msvc, but I'm not opposed to it. I'd like to implement it in such a way that allows us to compile MFC code that depends on it. With that said here are some open questions.
- MSDN says that __super can't be used with using declarations but current patch doesn't emit a diagnostic in this case. I'd say that we don't have to because since msvc doesn't allow this there's no code written that does it.
- MSDN says that all accessible base class methods are considered during overload resolution with best one being selected. This is different from normal C++ rules where ordinary name lookup results in ambiguity. Current patch doesn't implement this logic (second test case fails) but similarly to my previous observation we might not need it as MFC doesn't use multiple inheritance. Client's might run into this issue in their classes, but in that case they can fix the code and move away from this extension.
What are your thoughts on this?
I would drop the "Ms" prefix, and just have a NestedNameSpecifier::Super enumerator. If gcc adds an incompatible super-like NNS we can cross that bridge when we get there.