[PATCH] D26205: [clang-query] Fix Clang-tidy readability-redundant-string-cstr warnings

Malcolm Parsons via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 1 10:56:36 PDT 2016


malcolm.parsons created this revision.
malcolm.parsons added reviewers: pcc, dblaikie.
malcolm.parsons added a subscriber: cfe-commits.

https://reviews.llvm.org/D26205

Files:
  clang-query/tool/ClangQuery.cpp


Index: clang-query/tool/ClangQuery.cpp
===================================================================
--- clang-query/tool/ClangQuery.cpp
+++ clang-query/tool/ClangQuery.cpp
@@ -80,7 +80,7 @@
     for (cl::list<std::string>::iterator I = Commands.begin(),
                                          E = Commands.end();
          I != E; ++I) {
-      QueryRef Q = QueryParser::parse(I->c_str(), QS);
+      QueryRef Q = QueryParser::parse(*I, QS);
       if (!Q->run(llvm::outs(), QS))
         return 1;
     }
@@ -97,7 +97,7 @@
         std::string Line;
         std::getline(Input, Line);
 
-        QueryRef Q = QueryParser::parse(Line.c_str(), QS);
+        QueryRef Q = QueryParser::parse(Line, QS);
         if (!Q->run(llvm::outs(), QS))
           return 1;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26205.76597.patch
Type: text/x-patch
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161101/b7bad4e3/attachment.bin>


More information about the cfe-commits mailing list