alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


================
Comment at: clang-tidy/misc/IoFunctionsMisusedCheck.cpp:33
+              has(cxxMemberCallExpr(
+                  on(hasType(namedDecl(matchesName("istream")))),
+                  callee(cxxMethodDecl(hasName("get")).bind("Decl"))))),
----------------
`matchesName` can be pretty expensive and should generally be avoided. What set 
of types should be matched here? Can they all be listed here (using hasAnyName)?


================
Comment at: clang-tidy/misc/IoFunctionsMisusedCheck.cpp:43-46
+  const auto *FuncDeclInStd =
+      Result.Nodes.getNodeAs<FunctionDecl>("FuncDeclInStd");
+  const auto *FuncDeclInGlobal =
+      Result.Nodes.getNodeAs<FunctionDecl>("FuncDeclInGlobal");
----------------
It looks like the code doesn't need to distinguish between these two. They can 
be bound to the same ID then.


================
Comment at: clang-tidy/misc/IoFunctionsMisusedCheck.h:19
+
+/// This checker warns for cases when the return value of certain standard
+/// iostream C functions (fgetwc, getwc, getwchar, istream::get()) return int
----------------
s/checker/check/


================
Comment at: docs/clang-tidy/checks/misc-io-functions-misused.rst:26-27
+       char c;
+c = is.get();                   // Warning about incorrectly stored int value
+        c = ownnamespace::get() // Won't warn
+       
----------------
The formatting is off.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42682



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

Reply via email to