Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Remove GCC 7.2 workarounds #73574

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 2 additions & 18 deletions flang/lib/Evaluate/variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,15 +567,7 @@ template <typename T> BaseObject Designator<T>::GetBaseObject() const {
common::visitors{
[](SymbolRef symbol) { return BaseObject{symbol}; },
[](const Substring &sstring) { return sstring.GetBaseObject(); },
[](const auto &x) {
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
Substring>) {
return x.GetBaseObject();
} else
#endif
return BaseObject{x.GetFirstSymbol()};
},
[](const auto &x) { return BaseObject{x.GetFirstSymbol()}; },
},
u);
}
Expand All @@ -585,15 +577,7 @@ template <typename T> const Symbol *Designator<T>::GetLastSymbol() const {
common::visitors{
[](SymbolRef symbol) { return &*symbol; },
[](const Substring &sstring) { return sstring.GetLastSymbol(); },
[](const auto &x) {
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
if constexpr (std::is_same_v<std::decay_t<decltype(x)>,
Substring>) {
return x.GetLastSymbol();
} else
#endif
return &x.GetLastSymbol();
},
[](const auto &x) { return &x.GetLastSymbol(); },
},
u);
}
Expand Down
20 changes: 4 additions & 16 deletions flang/lib/Semantics/symbol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -733,22 +733,10 @@ bool GenericKind::IsOperator() const {

std::string GenericKind::ToString() const {
return common::visit(
common::visitors {
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
#if !__clang__ && __GNUC__ == 7 && __GNUC_MINOR__ == 2
[](const common::NumericOperator &x) {
return std::string{common::EnumToString(x)};
},
[](const common::LogicalOperator &x) {
return std::string{common::EnumToString(x)};
},
[](const common::RelationalOperator &x) {
return std::string{common::EnumToString(x)};
},
#else
[](const auto &x) { return std::string{common::EnumToString(x)}; },
#endif
common::visitors{
[](const OtherKind &x) { return std::string{EnumToString(x)}; },
[](const common::DefinedIo &x) { return AsFortran(x).ToString(); },
[](const auto &x) { return std::string{common::EnumToString(x)}; },
},
u);
}
Expand Down
Loading