[flang-commits] [flang] [flang][near NFC] Fix English in an error message (PR #151029)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Mon Jul 28 12:47:57 PDT 2025
https://github.com/klausler created https://github.com/llvm/llvm-project/pull/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 https://github.com/llvm/llvm-project/issues/150864.
>From 4e6fd9413d040fdf5537f1bebbcd7a2ed0d7a705 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Mon, 28 Jul 2025 12:45:19 -0700
Subject: [PATCH] [flang][near NFC] Fix English in an error message
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 https://github.com/llvm/llvm-project/issues/150864.
---
flang/lib/Semantics/pointer-assignment.cpp | 16 ++++++++--------
flang/test/Semantics/assign02.f90 | 2 +-
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp
index 090876912138a..e767bf840957c 100644
--- a/flang/lib/Semantics/pointer-assignment.cpp
+++ b/flang/lib/Semantics/pointer-assignment.cpp
@@ -270,18 +270,18 @@ bool PointerAssignmentChecker::Check(const evaluate::FunctionRef<T> &f) {
std::optional<MessageFixedText> msg;
const auto &funcResult{proc->functionResult}; // C1025
if (!funcResult) {
- msg = "%s is associated with the non-existent result of reference to"
- " procedure"_err_en_US;
+ msg =
+ "%s is associated with the non-existent result of reference to procedure"_err_en_US;
} else if (CharacterizeProcedure()) {
// Shouldn't be here in this function unless lhs is an object pointer.
- msg = "Procedure %s is associated with the result of a reference to"
- " function '%s' that does not return a procedure pointer"_err_en_US;
+ msg =
+ "Procedure %s is associated with the result of a reference to function '%s' that does not return a procedure pointer"_err_en_US;
} else if (funcResult->IsProcedurePointer()) {
- msg = "Object %s is associated with the result of a reference to"
- " function '%s' that is a procedure pointer"_err_en_US;
+ msg =
+ "Object %s is associated with the result of a reference to function '%s' that is a procedure pointer"_err_en_US;
} else if (!funcResult->attrs.test(FunctionResult::Attr::Pointer)) {
- msg = "%s is associated with the result of a reference to function '%s'"
- " that is a not a pointer"_err_en_US;
+ msg =
+ "%s is associated with the result of a reference to function '%s' that is not a pointer"_err_en_US;
} else if (isContiguous_ &&
!funcResult->attrs.test(FunctionResult::Attr::Contiguous)) {
auto restorer{common::ScopedSet(lhs_, symbol)};
diff --git a/flang/test/Semantics/assign02.f90 b/flang/test/Semantics/assign02.f90
index f998197aeab58..c4470789476ad 100644
--- a/flang/test/Semantics/assign02.f90
+++ b/flang/test/Semantics/assign02.f90
@@ -139,7 +139,7 @@ subroutine s9
real, target :: x
real, pointer :: p
p => f1()
- !ERROR: pointer 'p' is associated with the result of a reference to function 'f2' that is a not a pointer
+ !ERROR: pointer 'p' is associated with the result of a reference to function 'f2' that is not a pointer
p => f2()
contains
function f1()
More information about the flang-commits
mailing list