[PATCH] D70849: [AST] Traverse the class type loc inside the member pointer type loc.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 29 06:41:48 PST 2019


ilya-biryukov added inline comments.


================
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:1165
 
 // FIXME: location of base class?
 // We traverse this in the type case as well, but how is it not reached through
----------------
Remove this FIXME


================
Comment at: clang/include/clang/AST/RecursiveASTVisitor.h:1169
 DEF_TRAVERSE_TYPELOC(MemberPointerType, {
-  TRY_TO(TraverseType(QualType(TL.getTypePtr()->getClass(), 0)));
+  if (auto *TSI = TL.getClassTInfo())
+    TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()));
----------------
Can this actually happen in practice?
Did we try doing **only** `TRY_TO(TraverseTypeLoc(TSI->getTypeLoc()))` and seeing whether this fails?

The code in `MemberPointerTypeLoc` suggests this can happen, but would be interesting to find examples when it happens.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70849/new/

https://reviews.llvm.org/D70849





More information about the cfe-commits mailing list