[&](const parser::Name &name) {
auto const *symbol{name.symbol};
if (!IsVariableName(*symbol)) {
- context_.messages().Say(name.source,
+ context_.Say(name.source,
"name in DEALLOCATE statement must be a variable name"_err_en_US);
} else if (!IsAllocatableOrPointer(*symbol)) { // C932
- context_.messages().Say(name.source,
+ context_.Say(name.source,
"name in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute"_err_en_US);
}
},
if (MaybeExpr checked{analyzer.Analyze(structureComponent)}) {
if (!IsAllocatableOrPointer(
*structureComponent.component.symbol)) { // C932
- context_.messages().Say(structureComponent.component.source,
+ context_.Say(structureComponent.component.source,
"component in DEALLOCATE statement must have the ALLOCATABLE or POINTER attribute"_err_en_US);
}
}
},
allocateObject.u);
}
- // The parser is catching dups too
bool gotStat{false}, gotMsg{false};
for (const parser::StatOrErrmsg &deallocOpt :
std::get<std::list<parser::StatOrErrmsg>>(deallocateStmt.t)) {
!ERROR: Must have default CHARACTER type
Deallocate(x%p, stat=r, errmsg=e)
+!ERROR: STAT may not be duplicated in a DEALLOCATE statement
+Deallocate(x, stat=s, stat=s)
+!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
+Deallocate(x, errmsg=ee, errmsg=ee)
+!ERROR: STAT may not be duplicated in a DEALLOCATE statement
+Deallocate(x, stat=s, errmsg=ee, stat=s)
+!ERROR: ERRMSG may not be duplicated in a DEALLOCATE statement
+Deallocate(x, stat=s, errmsg=ee, errmsg=ee)
+
End Program