@@ -83,7 +83,7 @@ template <typename A> bool IsAssumedRank(const Designator<A> &designator) {
83
83
}
84
84
}
85
85
template <typename T> bool IsAssumedRank (const Expr<T> &expr) {
86
- return common ::visit ([](const auto &x) { return IsAssumedRank (x); }, expr.u );
86
+ return std ::visit ([](const auto &x) { return IsAssumedRank (x); }, expr.u );
87
87
}
88
88
template <typename A> bool IsAssumedRank (const std::optional<A> &x) {
89
89
return x && IsAssumedRank (*x);
@@ -100,7 +100,7 @@ template <typename A> bool IsCoarray(const Designator<A> &designator) {
100
100
return false ;
101
101
}
102
102
template <typename T> bool IsCoarray (const Expr<T> &expr) {
103
- return common ::visit ([](const auto &x) { return IsCoarray (x); }, expr.u );
103
+ return std ::visit ([](const auto &x) { return IsCoarray (x); }, expr.u );
104
104
}
105
105
template <typename A> bool IsCoarray (const std::optional<A> &x) {
106
106
return x && IsCoarray (*x);
@@ -177,11 +177,11 @@ auto UnwrapExpr(B &x) -> common::Constify<A, B> * {
177
177
return UnwrapExpr<A>(*expr);
178
178
}
179
179
} else if constexpr (std::is_same_v<Ty, Expr<SomeType>>) {
180
- return common ::visit ([](auto &x) { return UnwrapExpr<A>(x); }, x.u );
180
+ return std ::visit ([](auto &x) { return UnwrapExpr<A>(x); }, x.u );
181
181
} else if constexpr (!common::HasMember<A, TypelessExpression>) {
182
182
if constexpr (std::is_same_v<Ty, Expr<ResultType<A>>> ||
183
183
std::is_same_v<Ty, Expr<SomeKind<ResultType<A>::category>>>) {
184
- return common ::visit ([](auto &x) { return UnwrapExpr<A>(x); }, x.u );
184
+ return std ::visit ([](auto &x) { return UnwrapExpr<A>(x); }, x.u );
185
185
}
186
186
}
187
187
return nullptr ;
@@ -217,17 +217,15 @@ auto UnwrapConvertedExpr(B &x) -> common::Constify<A, B> * {
217
217
return UnwrapConvertedExpr<A>(*expr);
218
218
}
219
219
} else if constexpr (std::is_same_v<Ty, Expr<SomeType>>) {
220
- return common::visit (
221
- [](auto &x) { return UnwrapConvertedExpr<A>(x); }, x.u );
220
+ return std::visit ([](auto &x) { return UnwrapConvertedExpr<A>(x); }, x.u );
222
221
} else if constexpr (!common::HasMember<A, TypelessExpression>) {
223
222
using Result = ResultType<A>;
224
223
if constexpr (std::is_same_v<Ty, Expr<Result>> ||
225
224
std::is_same_v<Ty, Expr<SomeKind<Result::category>>>) {
226
- return common::visit (
227
- [](auto &x) { return UnwrapConvertedExpr<A>(x); }, x.u );
225
+ return std::visit ([](auto &x) { return UnwrapConvertedExpr<A>(x); }, x.u );
228
226
} else if constexpr (std::is_same_v<Ty, Parentheses<Result>> ||
229
227
std::is_same_v<Ty, Convert<Result, Result::category>>) {
230
- return common ::visit (
228
+ return std ::visit (
231
229
[](auto &x) { return UnwrapConvertedExpr<A>(x); }, x.left ().u );
232
230
}
233
231
}
@@ -264,7 +262,7 @@ common::IfNoLvalue<std::optional<DataRef>, A> ExtractDataRef(
264
262
template <typename T>
265
263
std::optional<DataRef> ExtractDataRef (
266
264
const Designator<T> &d, bool intoSubstring = false ) {
267
- return common ::visit (
265
+ return std ::visit (
268
266
[=](const auto &x) -> std::optional<DataRef> {
269
267
if constexpr (common::HasMember<decltype (x), decltype (DataRef::u)>) {
270
268
return DataRef{x};
@@ -281,7 +279,7 @@ std::optional<DataRef> ExtractDataRef(
281
279
template <typename T>
282
280
std::optional<DataRef> ExtractDataRef (
283
281
const Expr<T> &expr, bool intoSubstring = false ) {
284
- return common ::visit (
282
+ return std ::visit (
285
283
[=](const auto &x) { return ExtractDataRef (x, intoSubstring); }, expr.u );
286
284
}
287
285
template <typename A>
@@ -330,7 +328,7 @@ bool IsArrayElement(const Expr<T> &expr, bool intoSubstring = true,
330
328
template <typename A>
331
329
std::optional<NamedEntity> ExtractNamedEntity (const A &x) {
332
330
if (auto dataRef{ExtractDataRef (x, true )}) {
333
- return common ::visit (
331
+ return std ::visit (
334
332
common::visitors{
335
333
[](SymbolRef &&symbol) -> std::optional<NamedEntity> {
336
334
return NamedEntity{symbol};
@@ -356,10 +354,10 @@ struct ExtractCoindexedObjectHelper {
356
354
std::optional<CoarrayRef> operator ()(const CoarrayRef &x) const { return x; }
357
355
template <typename A>
358
356
std::optional<CoarrayRef> operator ()(const Expr<A> &expr) const {
359
- return common ::visit (*this , expr.u );
357
+ return std ::visit (*this , expr.u );
360
358
}
361
359
std::optional<CoarrayRef> operator ()(const DataRef &dataRef) const {
362
- return common ::visit (*this , dataRef.u );
360
+ return std ::visit (*this , dataRef.u );
363
361
}
364
362
std::optional<CoarrayRef> operator ()(const NamedEntity &named) const {
365
363
if (const Component * component{named.UnwrapComponent ()}) {
@@ -451,7 +449,7 @@ Expr<TO> ConvertToType(Expr<SomeKind<FROMCAT>> &&x) {
451
449
ConvertToType<Part>(std::move (x)), Expr<Part>{Constant<Part>{zero}}}};
452
450
} else if constexpr (FROMCAT == TypeCategory::Complex) {
453
451
// Extract and convert the real component of a complex value
454
- return common ::visit (
452
+ return std ::visit (
455
453
[&](auto &&z) {
456
454
using ZType = ResultType<decltype (z)>;
457
455
using Part = typename ZType::Part;
@@ -505,7 +503,7 @@ common::IfNoLvalue<Expr<Type<TC, TK>>, FROM> ConvertTo(
505
503
template <TypeCategory TC, typename FROM>
506
504
common::IfNoLvalue<Expr<SomeKind<TC>>, FROM> ConvertTo (
507
505
const Expr<SomeKind<TC>> &to, FROM &&from) {
508
- return common ::visit (
506
+ return std ::visit (
509
507
[&](const auto &toKindExpr) {
510
508
using KindExpr = std::decay_t <decltype (toKindExpr)>;
511
509
return AsCategoryExpr (
@@ -517,7 +515,7 @@ common::IfNoLvalue<Expr<SomeKind<TC>>, FROM> ConvertTo(
517
515
template <typename FROM>
518
516
common::IfNoLvalue<Expr<SomeType>, FROM> ConvertTo (
519
517
const Expr<SomeType> &to, FROM &&from) {
520
- return common ::visit (
518
+ return std ::visit (
521
519
[&](const auto &toCatExpr) {
522
520
return AsGenericExpr (ConvertTo (toCatExpr, std::move (from)));
523
521
},
@@ -567,7 +565,7 @@ using SameKindExprs =
567
565
template <TypeCategory CAT>
568
566
SameKindExprs<CAT, 2 > AsSameKindExprs (
569
567
Expr<SomeKind<CAT>> &&x, Expr<SomeKind<CAT>> &&y) {
570
- return common ::visit (
568
+ return std ::visit (
571
569
[&](auto &&kx, auto &&ky) -> SameKindExprs<CAT, 2 > {
572
570
using XTy = ResultType<decltype (kx)>;
573
571
using YTy = ResultType<decltype (ky)>;
@@ -628,7 +626,7 @@ Expr<SPECIFIC> Combine(Expr<SPECIFIC> &&x, Expr<SPECIFIC> &&y) {
628
626
template <template <typename > class OPR , TypeCategory CAT>
629
627
Expr<SomeKind<CAT>> PromoteAndCombine (
630
628
Expr<SomeKind<CAT>> &&x, Expr<SomeKind<CAT>> &&y) {
631
- return common ::visit (
629
+ return std ::visit (
632
630
[](auto &&xy) {
633
631
using Ty = ResultType<decltype (xy[0 ])>;
634
632
return AsCategoryExpr (
@@ -729,7 +727,7 @@ Expr<Type<C, K>> operator/(Expr<Type<C, K>> &&x, Expr<Type<C, K>> &&y) {
729
727
}
730
728
731
729
template <TypeCategory C> Expr<SomeKind<C>> operator -(Expr<SomeKind<C>> &&x) {
732
- return common ::visit (
730
+ return std ::visit (
733
731
[](auto &xk) { return Expr<SomeKind<C>>{-std::move (xk)}; }, x.u );
734
732
}
735
733
@@ -874,7 +872,7 @@ std::optional<BaseObject> GetBaseObject(const Designator<T> &x) {
874
872
}
875
873
template <typename T>
876
874
std::optional<BaseObject> GetBaseObject (const Expr<T> &x) {
877
- return common ::visit ([](const auto &y) { return GetBaseObject (y); }, x.u );
875
+ return std ::visit ([](const auto &y) { return GetBaseObject (y); }, x.u );
878
876
}
879
877
template <typename A>
880
878
std::optional<BaseObject> GetBaseObject (const std::optional<A> &x) {
@@ -1014,8 +1012,7 @@ class ScalarConstantExpander {
1014
1012
return Expand (std::move (x.left ())); // Constant<> can be parenthesized
1015
1013
}
1016
1014
template <typename T> Expr<T> Expand (Expr<T> &&x) {
1017
- return common::visit (
1018
- [&](auto &&x) { return Expr<T>{Expand (std::move (x))}; },
1015
+ return std::visit ([&](auto &&x) { return Expr<T>{Expand (std::move (x))}; },
1019
1016
std::move (x.u ));
1020
1017
}
1021
1018
0 commit comments