Skip to content

Commit 119e9d5

Browse files
committed
[flang][OpenMP] Fix build break after fe8b323
Replace structured bindings with references where they are captured in a lambda.
1 parent 498f108 commit 119e9d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flang/lib/Semantics/check-omp-structure.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4718,7 +4718,12 @@ void OmpStructureChecker::CheckTraitSetSelector(
47184718
CheckTraitSelectorList(traits);
47194719

47204720
for (const parser::OmpTraitSelector &trait : traits) {
4721-
auto &[traitName, maybeProps]{trait.t};
4721+
// Don't use structured bindings here, because they cannot be captured
4722+
// before C++20.
4723+
auto &traitName = std::get<parser::OmpTraitSelectorName>(trait.t);
4724+
auto &maybeProps =
4725+
std::get<std::optional<parser::OmpTraitSelector::Properties>>(
4726+
trait.t);
47224727

47234728
// Check allowed traits
47244729
common::visit( //

0 commit comments

Comments
 (0)