Skip to content

Commit 13b2fc1

Browse files
authored
[flang][near NFC] Fix English in an error message (#151029)
Correct "is a not a pointer" to "is not a pointer" in an error message. While here, also unsplit nearby error messages so that their contents are more searchable. Fixes #150864.
1 parent b01ab53 commit 13b2fc1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

flang/lib/Semantics/pointer-assignment.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -270,18 +270,18 @@ bool PointerAssignmentChecker::Check(const evaluate::FunctionRef<T> &f) {
270270
std::optional<MessageFixedText> msg;
271271
const auto &funcResult{proc->functionResult}; // C1025
272272
if (!funcResult) {
273-
msg = "%s is associated with the non-existent result of reference to"
274-
" procedure"_err_en_US;
273+
msg =
274+
"%s is associated with the non-existent result of reference to procedure"_err_en_US;
275275
} else if (CharacterizeProcedure()) {
276276
// Shouldn't be here in this function unless lhs is an object pointer.
277-
msg = "Procedure %s is associated with the result of a reference to"
278-
" function '%s' that does not return a procedure pointer"_err_en_US;
277+
msg =
278+
"Procedure %s is associated with the result of a reference to function '%s' that does not return a procedure pointer"_err_en_US;
279279
} else if (funcResult->IsProcedurePointer()) {
280-
msg = "Object %s is associated with the result of a reference to"
281-
" function '%s' that is a procedure pointer"_err_en_US;
280+
msg =
281+
"Object %s is associated with the result of a reference to function '%s' that is a procedure pointer"_err_en_US;
282282
} else if (!funcResult->attrs.test(FunctionResult::Attr::Pointer)) {
283-
msg = "%s is associated with the result of a reference to function '%s'"
284-
" that is a not a pointer"_err_en_US;
283+
msg =
284+
"%s is associated with the result of a reference to function '%s' that is not a pointer"_err_en_US;
285285
} else if (isContiguous_ &&
286286
!funcResult->attrs.test(FunctionResult::Attr::Contiguous)) {
287287
auto restorer{common::ScopedSet(lhs_, symbol)};

flang/test/Semantics/assign02.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ subroutine s9
139139
real, target :: x
140140
real, pointer :: p
141141
p => f1()
142-
!ERROR: pointer 'p' is associated with the result of a reference to function 'f2' that is a not a pointer
142+
!ERROR: pointer 'p' is associated with the result of a reference to function 'f2' that is not a pointer
143143
p => f2()
144144
contains
145145
function f1()

0 commit comments

Comments
 (0)