JDevlieghere added inline comments.

================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:115
+  const auto *MakePairCall = Result.Nodes.getNodeAs<CallExpr>("make_pair");
+  assert(InnerCtorCall || MakePairCall);
 
----------------
It's highly recommended to put some kind of error message in the assertion 
statement, as per the LLVM coding standards.


================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:130
+  SourceRange CallParensRange;
+  if (MakePairCall)
+    CallParensRange = SourceRange(MakePairCall->getCallee()->getLocEnd(),
----------------
Can't we use the ternary operator here?


================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:140
 
+  SourceLocation ExprBegin;
+  if (MakePairCall)
----------------
Same here?


================
Comment at: clang-tidy/modernize/UseEmplaceCheck.cpp:147
   // Range for constructor name and opening brace.
-  auto CtorCallSourceRange = CharSourceRange::getTokenRange(
-      InnerCtorCall->getExprLoc(), CallParensRange.getBegin());
+  auto ParamCallSourceRange = CharSourceRange::getTokenRange(
+      ExprBegin, CallParensRange.getBegin());
----------------
I think this can be const.


https://reviews.llvm.org/D32395



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

Reply via email to