Skip to content

Commit 74e59e7

Browse files
authored
[flang] Remove GCC 7.2 workarounds (#73574)
The minimum GCC version was bumped from 7.1 to 7.4 so garbage collect the 7.2 workarounds. https://reviews.llvm.org/D156286
1 parent b935f1a commit 74e59e7

File tree

2 files changed

+6
-34
lines changed

2 files changed

+6
-34
lines changed

flang/lib/Evaluate/variable.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -567,15 +567,7 @@ template <typename T> BaseObject Designator<T>::GetBaseObject() const {
567567
common::visitors{
568568
[](SymbolRef symbol) { return BaseObject{symbol}; },
569569
[](const Substring &sstring) { return sstring.GetBaseObject(); },
570-
[](const auto &x) {
571-
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
572-
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
573-
Substring>) {
574-
return x.GetBaseObject();
575-
} else
576-
#endif
577-
return BaseObject{x.GetFirstSymbol()};
578-
},
570+
[](const auto &x) { return BaseObject{x.GetFirstSymbol()}; },
579571
},
580572
u);
581573
}
@@ -585,15 +577,7 @@ template <typename T> const Symbol *Designator<T>::GetLastSymbol() const {
585577
common::visitors{
586578
[](SymbolRef symbol) { return &*symbol; },
587579
[](const Substring &sstring) { return sstring.GetLastSymbol(); },
588-
[](const auto &x) {
589-
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
590-
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
591-
Substring>) {
592-
return x.GetLastSymbol();
593-
} else
594-
#endif
595-
return &x.GetLastSymbol();
596-
},
580+
[](const auto &x) { return &x.GetLastSymbol(); },
597581
},
598582
u);
599583
}

flang/lib/Semantics/symbol.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -733,22 +733,10 @@ bool GenericKind::IsOperator() const {
733733

734734
std::string GenericKind::ToString() const {
735735
return common::visit(
736-
common::visitors {
737-
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
738-
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
739-
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
740-
[](const common::NumericOperator &x) {
741-
return std::string{common::EnumToString(x)};
742-
},
743-
[](const common::LogicalOperator &x) {
744-
return std::string{common::EnumToString(x)};
745-
},
746-
[](const common::RelationalOperator &x) {
747-
return std::string{common::EnumToString(x)};
748-
},
749-
#else
750-
[](const auto &x) { return std::string{common::EnumToString(x)}; },
751-
#endif
736+
common::visitors{
737+
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
738+
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
739+
[](const auto &x) { return std::string{common::EnumToString(x)}; },
752740
},
753741
u);
754742
}

0 commit comments

Comments
 (0)