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

James King via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 4 08:12:36 PDT 2021


jcking1034 marked an inline comment as not done.
jcking1034 added inline comments.


================
Comment at: clang/unittests/AST/ASTTypeTraitsTest.cpp:212
+  DynTypedNode Node = DynTypedNode::create(tl);
+  EXPECT_TRUE(Node == Node);
+  EXPECT_FALSE(Node < Node);
----------------
sbenza wrote:
> I don't know what we are trying to check with this self equivalence.
> Did you mean `Node == tl`?
These two `EXPECT`s are meant to ensure that the overloaded equality and less-than operators do function correctly when handling nodes of the `TypeLoc` family. In both cases, there is behavior specifically for these nodes, and I've made minor updates to both (changing `isSame` to `isBaseOf`). Additionally, this may give a little more confidence that template specialization functioned correctly. I will note that the `QualType` test performs a similar set of checks, presumably for similar reasoning.


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