// Constraint checking
void ExpressionAnalysisContext::CheckConstraints(MaybeExpr &expr) {
- if (expr.has_value()) {
- if (inner_ != nullptr) {
- inner_->CheckConstraints(expr);
- }
- if (constraint_ != nullptr) {
- if (!(this->*constraint_)(*expr)) {
- expr.reset();
- }
+ if (inner_ != nullptr) {
+ inner_->CheckConstraints(expr);
+ }
+ if (constraint_ != nullptr && expr.has_value()) {
+ if (!(this->*constraint_)(*expr)) {
+ expr.reset();
}
}
}
#define FORTRAN_SEMANTICS_EXPRESSION_H_
#include "semantics.h"
+#include "../common/indirection.h"
#include "../evaluate/expression.h"
#include "../evaluate/type.h"
#include <optional>