aaron.ballman added inline comments.

================
Comment at: clang-tidy/performance/EmplaceCheck.cpp:26
@@ +25,3 @@
+          on(expr(hasType(cxxRecordDecl(hasName("std::vector"))))),
+          callee(functionDecl(hasName("push_back"))),
+          hasArgument(0, cxxConstructExpr().bind("construct_expr")))
----------------
sbenza wrote:
> Just say functionDecl(hasName("std::vector::push_back")) and you can remove 
> the type check.
Should use "::std::vector::push_back" just to be sure it doesn't explode when 
evil people have:
```
namespace frobble {
namespace std {
template <typename T>
class vector {
  void push_back(const T&);
};
}
}
```

================
Comment at: clang-tidy/performance/EmplaceCheck.cpp:38
@@ +37,3 @@
+  if (SR.isInvalid())
+    return {};
+  return Lexer::getSourceText(Lexer::getAsCharRange(SR, SM, LO), SM, LO);
----------------
I think this goes against our coding standards and should be `return 
StringRef();`.


http://reviews.llvm.org/D21185



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

Reply via email to