using Attr = characteristics::Procedure::Attr;
auto lhsAttrs{rhs.attrs};
lhsAttrs.set(
- Attr::Pure, lhs.attrs.test(Attr::Pure) | rhs.attrs.test(Attr::Pure));
+ Attr::Pure, lhs.attrs.test(Attr::Pure) || rhs.attrs.test(Attr::Pure));
lhsAttrs.set(Attr::Elemental,
- lhs.attrs.test(Attr::Elemental) | rhs.attrs.test(Attr::Elemental));
+ lhs.attrs.test(Attr::Elemental) || rhs.attrs.test(Attr::Elemental));
return lhsAttrs == rhs.attrs && lhs.functionResult == rhs.functionResult &&
lhs.dummyArguments == rhs.dummyArguments;
}
} else if (proc.dummyArguments.size() != 2) {
msg = "Defined assignment subroutine '%s' must have"
" two dummy arguments"_err_en_US;
- } else if (!CheckDefinedAssignmentArg(specific, proc.dummyArguments[0], 0) |
- !CheckDefinedAssignmentArg(specific, proc.dummyArguments[1], 1)) {
- return false; // error was reported
- } else if (ConflictsWithIntrinsicAssignment(proc)) {
- msg = "Defined assignment subroutine '%s' conflicts with"
- " intrinsic assignment"_err_en_US;
} else {
- return true; // OK
+ // Check both arguments even if the first has an error.
+ bool ok0{CheckDefinedAssignmentArg(specific, proc.dummyArguments[0], 0)};
+ bool ok1{CheckDefinedAssignmentArg(specific, proc.dummyArguments[1], 1)};
+ if (!(ok0 && ok1)) {
+ return false; // error was reported
+ } else if (ConflictsWithIntrinsicAssignment(proc)) {
+ msg = "Defined assignment subroutine '%s' conflicts with"
+ " intrinsic assignment"_err_en_US;
+ } else {
+ return true; // OK
+ }
}
SayWithDeclaration(specific, std::move(msg.value()), specific.name());
context_.SetError(specific);