[clang-tools-extra] r295600 - clangd/ASTManager.cpp: Appease msc19 Debug build -- Don't deref std::vector::end().

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 18 23:18:16 PST 2017


Author: chapuni
Date: Sun Feb 19 01:18:16 2017
New Revision: 295600

URL: http://llvm.org/viewvc/llvm-project?rev=295600&view=rev
Log:
clangd/ASTManager.cpp: Appease msc19 Debug build -- Don't deref std::vector::end().

Modified:
    clang-tools-extra/trunk/clangd/ASTManager.cpp

Modified: clang-tools-extra/trunk/clangd/ASTManager.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/ASTManager.cpp?rev=295600&r1=295599&r2=295600&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/ASTManager.cpp (original)
+++ clang-tools-extra/trunk/clangd/ASTManager.cpp Sun Feb 19 01:18:16 2017
@@ -190,8 +190,9 @@ ASTManager::createASTUnitForFile(StringR
   for (const auto &S : Commands.front().CommandLine)
     ArgStrs.push_back(S.c_str());
 
+  auto ArgP = &*ArgStrs.begin();
   return std::unique_ptr<clang::ASTUnit>(ASTUnit::LoadFromCommandLine(
-      &*ArgStrs.begin(), &*ArgStrs.end(), PCHs, Diags, ResourceDir,
+      ArgP, ArgP + ArgStrs.size(), PCHs, Diags, ResourceDir,
       /*OnlyLocalDecls=*/false, /*CaptureDiagnostics=*/true,
       getRemappedFiles(Docs),
       /*RemappedFilesKeepOriginalName=*/true,




More information about the cfe-commits mailing list