NoQ added a comment.

Hmm, this might make a good `optin.*` checker. Also i see that this is a pure 
AST-based checker; did you consider putting this into `clang-tidy`? Like, you 
shouldn't if you're not using `clang-tidy` yourself (it's a bit messy) but this 
is an option. Also we're actively using `ASTMatchers` in Analyzer checkers 
anyway these days because they're just shorter and easier to read and generally 
cool.



================
Comment at: lib/StaticAnalyzer/Checkers/PointerSortingChecker.cpp:91-100
+  const QualType IterTy = CE->getArg(0)->getType();
+  const RecordDecl *RD =
+    IterTy->getUnqualifiedDesugaredType()->getAsCXXRecordDecl();
+
+  if (RD->field_empty())
+    return;
+
----------------
This heuristic ("the argument of `std::sort` is //a class whose first field is 
of pointer type//") is quite wonky, do you have a plan on how to make it more 
precise?


Repository:
  rC Clang

https://reviews.llvm.org/D50488



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

Reply via email to