f18 was diagnosing the misuse of a procedure pointer as an output item,
but not the more general case of a procedure designator other than
a pointer.
Differential Revision: https://reviews.llvm.org/
D143780
if (evaluate::IsBOZLiteral(*expr)) {
context_.Say(parser::FindSourceLocation(*x), // C7109
"Output item must not be a BOZ literal constant"_err_en_US);
- }
- const Symbol *last{GetLastSymbol(*expr)};
- if (last && IsProcedurePointer(*last)) {
+ } else if (IsProcedure(*expr)) {
context_.Say(parser::FindSourceLocation(*x),
- "Output item must not be a procedure pointer"_err_en_US); // C1233
+ "Output item must not be a procedure"_err_en_US); // C1233
}
CheckForBadIoType(*expr,
flags_.test(Flag::FmtOrNml)
std::optional<DataRef> dataRef{ExtractDataRef(std::move(result))};
if (!dataRef) {
dataRef = ExtractDataRef(std::move(result), /*intoSubstring=*/true);
- if (!dataRef) {
- dataRef = ExtractDataRef(std::move(result),
- /*intoSubstring=*/false, /*intoComplexPart=*/true);
- }
+ }
+ if (!dataRef) {
+ dataRef = ExtractDataRef(std::move(result),
+ /*intoSubstring=*/false, /*intoComplexPart=*/true);
}
if (dataRef && !CheckDataRef(*dataRef)) {
result.reset();
integer, pointer :: a(:)
integer, parameter :: const_id = 66666
procedure(), pointer :: procptr
+ external external
+ intrinsic acos
namelist /nnn/ nn1, nn2
write(*, '(X)')
- !ERROR: Output item must not be a procedure pointer
- print*, n1, procptr, n2
+ !ERROR: Output item must not be a procedure
+ print*, procptr
+ !ERROR: Output item must not be a procedure
+ print*, acos
+ !ERROR: Output item must not be a procedure
+ print*, external
1 format (A)
9 continue