[flang][msvc] Avoid range-based for over initializer_list. NFC.

Msvc crashes with "INTERNAL COMPILER ERROR" when iterating over an `std::initializer_list` in a constexpr constructor. Explicitly use the iterator instead.

This patch is part of the series to [[ http://lists.llvm.org/pipermail/flang-dev/2020-July/000448.html | make flang compilable with MS Visual Studio ]].

Reviewed By: isuruf

Differential Revision: https://reviews.llvm.org/D86425
This commit is contained in:
Michael Kruse 2020-09-08 21:52:23 -05:00
parent 795e4ee9d2
commit c58dfbdc81
1 changed files with 2 additions and 2 deletions

View File

@ -37,8 +37,8 @@ public:
constexpr EnumSet() {}
constexpr EnumSet(const std::initializer_list<enumerationType> &enums) {
for (auto x : enums) {
set(x);
for (auto it{enums.begin()}; it != enums.end(); ++it) {
set(*it);
}
}
constexpr EnumSet(const EnumSet &) = default;