File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,13 @@ namespace Fortran::parser {
2929struct Keyword ;
3030}
3131
32+ namespace Fortran ::evaluate { // avoid including all of Evaluate/tools.h
33+ template <typename T>
34+ std::optional<bool > AreEquivalentInInterface (const Expr<T> &, const Expr<T> &);
35+ extern template std::optional<bool > AreEquivalentInInterface<SomeInteger>(
36+ const Expr<SomeInteger> &, const Expr<SomeInteger> &);
37+ } // namespace Fortran::evaluate
38+
3239namespace Fortran ::semantics {
3340
3441class Scope ;
@@ -110,7 +117,11 @@ class ParamValue {
110117 return category_ == that.category_ && expr_ == that.expr_ ;
111118 }
112119 bool operator !=(const ParamValue &that) const { return !(*this == that); }
113- bool IsEquivalentInInterface (const ParamValue &) const ;
120+ bool IsEquivalentInInterface (const ParamValue &that) const {
121+ return (category_ == that.category_ &&
122+ expr_.has_value () == that.expr_ .has_value () &&
123+ (!expr_ || evaluate::AreEquivalentInInterface (*expr_, *that.expr_ )));
124+ }
114125 std::string AsFortran () const ;
115126
116127private:
Original file line number Diff line number Diff line change @@ -758,12 +758,6 @@ void ParamValue::SetExplicit(SomeIntExpr &&x) {
758758 expr_ = std::move (x);
759759}
760760
761- bool ParamValue::IsEquivalentInInterface (const ParamValue &that) const {
762- return (category_ == that.category_ &&
763- expr_.has_value () == that.expr_ .has_value () &&
764- (!expr_ || evaluate::AreEquivalentInInterface (*expr_, *that.expr_ )));
765- }
766-
767761std::string ParamValue::AsFortran () const {
768762 switch (category_) {
769763 SWITCH_COVERS_ALL_CASES
You can’t perform that action at this time.
0 commit comments