[PATCH] D19144: Handle TemplateArgument in DynTypedNode comparison operations.

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 14 19:40:59 PDT 2016


alexfh created this revision.
alexfh added reviewers: sbenza, bkramer.
alexfh added a subscriber: cfe-commits.

This patch fixes an assertion failure on some matchers containing
templateArgument() on some code in some configurations. I couldn't come up with a
consistent repro, since the failure depens on the order of elements in a map.
http://reviews.llvm.org/D18136 contains a matcher that causes the issue at least
on some configurations.

The fix turned out to require non-trivial amount of code, very similar to
TemplateArgument::structurallyEquals. I'd prefer to use
TemplateArgument::Profile, if it was possible without ASTContext. Another
alternative would be to add operator< for TemplateArgument, but since it's only
needed in DynTypedNode, I decided to make this code private to DynTypedNode.

http://reviews.llvm.org/D19144

Files:
  include/clang/AST/ASTTypeTraits.h
  lib/AST/ASTTypeTraits.cpp
  unittests/AST/ASTTypeTraitsTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19144.53832.patch
Type: text/x-patch
Size: 5427 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160415/1ab05366/attachment-0001.bin>


More information about the cfe-commits mailing list