[PATCH] D110586: Update `DynTypedNode` to support the conversion of `TypeLoc`s.

Samuel Benzaquen via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 1 13:30:08 PDT 2021


sbenza added inline comments.


================
Comment at: clang/unittests/AST/ASTTypeTraitsTest.cpp:212
+  DynTypedNode Node = DynTypedNode::create(tl);
+  EXPECT_TRUE(Node == Node);
+  EXPECT_FALSE(Node < Node);
----------------
I don't know what we are trying to check with this self equivalence.
Did you mean `Node == tl`?


================
Comment at: clang/unittests/AST/ASTTypeTraitsTest.cpp:225
+  const auto ptl =
+      matches[0].getNodeAs<TypeLoc>("ptl")->castAs<PointerTypeLoc>();
+  DynTypedNode Node = DynTypedNode::create(ptl);
----------------
We should check that we can do getNodeAs<PointerTypeLoc> and getNodeAs<TypeLoc>.
That is the goal of having the hierarchy in DynTypedNode.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110586



More information about the cfe-commits mailing list