mgrang added a comment.

I was trying to write another checker for hashing of pointers. Basically, I 
wanted to match all instances where the keys of std::map are pointers. Writing 
an AST matcher for std::map is straightforward. However, I am not sure how to 
check for pointer keys after matching std::map.

The following matches std::map<K, V>. But I need to match std::map<int *, V>. 
So I was thinking something on the lines of 
templateArgument(hasType(pointerType())).

  auto ContainersM = anyOf(
                       hasName("std::map"),
                       hasName("std::unordered_map")
                     );
  
  auto HashContainerM = varDecl(hasType(cxxRecordDecl(ContainersM)))


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

https://reviews.llvm.org/D59279



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to