summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2014-04-30 19:59:22 +0000
committerArnaud A. de Grandmaison <arnaud.adegm@gmail.com>2014-04-30 19:59:22 +0000
commite1265143e289af642ffb074764fe8763a5e6587c (patch)
tree530212f51ee61677484e1b7473a1e4d552d0fe6d /clang/lib
parenta1fbf3459fd1a2f480183615893065f0c2e9dae9 (diff)
downloadbcm5719-llvm-e1265143e289af642ffb074764fe8763a5e6587c.tar.gz
bcm5719-llvm-e1265143e289af642ffb074764fe8763a5e6587c.zip
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
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Tooling/CompilationDatabase.cpp5
1 files changed, 3 insertions, 2 deletions
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<const char *> 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<driver::Compilation> Compilation(
NewDriver->BuildCompilation(Args));
OpenPOWER on IntegriCloud