diff options
| author | Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> | 2014-04-30 19:59:22 +0000 |
|---|---|---|
| committer | Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> | 2014-04-30 19:59:22 +0000 |
| commit | ac011f7b0309ebcea9ce1e4dc118c22afb21c2b8 (patch) | |
| tree | b0f7eed435d6eda999dc6f6811359d957f5b7aa2 /lib/Tooling/CompilationDatabase.cpp | |
| parent | cc1fce58faa4b0d789b9cfaeae1002504514d45c (diff) | |
| download | clang-ac011f7b0309ebcea9ce1e4dc118c22afb21c2b8.tar.gz clang-ac011f7b0309ebcea9ce1e4dc118c22afb21c2b8.tar.bz2 clang-ac011f7b0309ebcea9ce1e4dc118c22afb21c2b8.tar.xz | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/CompilationDatabase.cpp')
| -rw-r--r-- | lib/Tooling/CompilationDatabase.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Tooling/CompilationDatabase.cpp b/lib/Tooling/CompilationDatabase.cpp index b513446a54..ec4d604825 100644 --- a/lib/Tooling/CompilationDatabase.cpp +++ b/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)); |
