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
// 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));