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 make flang compilable with MS Visual Studio.
Differential D86425
[flang][msvc] Avoid range-based for over initializer_list. NFC. Meinersbur on Aug 23 2020, 8:05 PM. Authored by
Details 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 make flang compilable with MS Visual Studio.
Diff Detail Event TimelineComment Actions Bug was was already reported (but no yet fixed) at https://developercommunity.visualstudio.com/content/problem/1067774/ice-internal-compiler-error-on-constexpr-range-bas.html.
|
To match the style of the flang project this should be:
for (auto it{enums.begin()}; it != enums.end(); ++it) {