[PATCH] PR13236 - Microsoft compatibility: support __super specifier to access members of base classes

Nikola Smiljanić popizdeh at gmail.com
Thu Jul 10 21:57:46 PDT 2014


Hi aaron.ballman, rnk, rsmith,

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?

http://reviews.llvm.org/D4468

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/DataRecursiveASTVisitor.h
  include/clang/AST/NestedNameSpecifier.h
  include/clang/AST/RecursiveASTVisitor.h
  include/clang/Basic/TokenKinds.def
  include/clang/Sema/DeclSpec.h
  include/clang/Sema/Sema.h
  lib/AST/ASTContext.cpp
  lib/AST/ASTImporter.cpp
  lib/AST/ItaniumMangle.cpp
  lib/AST/NestedNameSpecifier.cpp
  lib/Parse/ParseExpr.cpp
  lib/Parse/ParseExprCXX.cpp
  lib/Parse/Parser.cpp
  lib/Sema/DeclSpec.cpp
  lib/Sema/SemaCXXScopeSpec.cpp
  lib/Sema/SemaExpr.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaLookup.cpp
  lib/Sema/SemaTemplate.cpp
  lib/Sema/SemaType.cpp
  lib/Sema/TreeTransform.h
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTWriter.cpp
  test/SemaCXX/MicrosoftExtensions.cpp
  tools/libclang/CIndex.cpp
  tools/libclang/IndexTypeSourceInfo.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4468.11305.patch
Type: text/x-patch
Size: 23758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140711/e588b57e/attachment.bin>


More information about the cfe-commits mailing list