[PATCH] D22346: [Clang-tidy] CERT-MSC50-CPP (std:rand() )

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 14 11:59:56 PDT 2016


Prazek added inline comments.

================
Comment at: clang-tidy/cert/LimitedRandomnessCheck.cpp:22-23
@@ +21,4 @@
+  Finder->addMatcher(
+      declRefExpr(hasDeclaration(functionDecl(namedDecl(hasName("::rand")),
+                                              parameterCountIs(0))))
+          .bind("randomGenerator"),
----------------
aaron.ballman wrote:
> This should be looking at a callExpr() rather than a declRefExpr(), should it not?
I was also thinking about this, but this is actually better, because it will also match with binding rand with function pointer.


Repository:
  rL LLVM

https://reviews.llvm.org/D22346





More information about the cfe-commits mailing list