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

Nikola Smiljanić popizdeh at gmail.com
Mon Aug 11 23:09:52 PDT 2014


I've gone full circle on this, Richard suggested resolving 'super' right away. I consumed tokens and annotated the trailing identifier as either type or primary expression. It was so simple and worked perfectly, until dependent bases showed up...

I started hacking and soon enough ended up with something that looks very much like the original patch with few minor changes. NNS now stores the CXXRecordDecl of the class 'super' appeared in, this is replaced by appropriate instantiation in case of templates. This makes us handle the 'derive from template parameter' case just fine, unlike msvc, but I'm fine with it. I guess we could produce an error like them if we wanted but I don't see the point.

I played with printfs to check if the right overload was selected but having tests would be nice. Do I emit IR, dump ast, or to something else?

http://reviews.llvm.org/D4468

Files:
  include/clang/AST/DataRecursiveASTVisitor.h
  include/clang/AST/NestedNameSpecifier.h
  include/clang/AST/RecursiveASTVisitor.h
  include/clang/Basic/DiagnosticParseKinds.td
  include/clang/Basic/DiagnosticSemaKinds.td
  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/ParseDecl.cpp
  lib/Parse/ParseDeclCXX.cpp
  lib/Parse/ParseExpr.cpp
  lib/Parse/ParseExprCXX.cpp
  lib/Parse/ParseTentative.cpp
  lib/Parse/Parser.cpp
  lib/Sema/DeclSpec.cpp
  lib/Sema/SemaCXXScopeSpec.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaLookup.cpp
  lib/Sema/SemaOverload.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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4468.12386.patch
Type: text/x-patch
Size: 33395 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140812/b89d026b/attachment.bin>


More information about the cfe-commits mailing list