[flang] Fix build on OSX

Original-commit: flang-compiler/f18@453b03af1c
Reviewed-on: https://github.com/flang-compiler/f18/pull/760
This commit is contained in:
peter klausler 2019-09-25 10:40:01 -07:00
parent b80a8dcc1f
commit 55e241a722
1 changed files with 4 additions and 3 deletions

View File

@ -279,12 +279,13 @@ struct SetTraverse : public Base {
using Base::operator();
static Set Default() { return {}; }
static Set Combine(Set &&x, Set &&y) {
#if CLANG_LIBRARIES // no std::set::merge()
#if defined __GNUC__ && !defined __APPLE__ && !(CLANG_LIBRARIES)
x.merge(y);
#else
// std::set::merge() not available (yet)
for (auto &value : y) {
x.insert(std::move(value));
}
#else
x.merge(y);
#endif
return std::move(x);
}