From e1265143e289af642ffb074764fe8763a5e6587c Mon Sep 17 00:00:00 2001 From: "Arnaud A. de Grandmaison" Date: Wed, 30 Apr 2014 19:59:22 +0000 Subject: PR19601: std::remove_if does not really remove the elements. It moves them at the end of the range instead, so an extra erase is needed. It is strange that this code works without the erase. On the other hand, removing the remove_if will make fail some tests. llvm-svn: 207696 --- clang/lib/Tooling/CompilationDatabase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/Tooling/CompilationDatabase.cpp') diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index b513446a543..ec4d604825c 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -238,8 +238,9 @@ static bool stripPositionalArgs(std::vector Args, // Remove -no-integrated-as; it's not used for syntax checking, // and it confuses targets which don't support this option. - std::remove_if(Args.begin(), Args.end(), - MatchesAny(std::string("-no-integrated-as"))); + Args.erase(std::remove_if(Args.begin(), Args.end(), + MatchesAny(std::string("-no-integrated-as"))), + Args.end()); const std::unique_ptr Compilation( NewDriver->BuildCompilation(Args)); -- cgit v1.2.3