[flang-commits] [flang] [flang] Fix "suspicious condition" in C++ usage (PR #82790)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Fri Feb 23 08:47:46 PST 2024
https://github.com/klausler created https://github.com/llvm/llvm-project/pull/82790
Address a reported C++ coding "suspicious condition".
Fixes https://github.com/llvm/llvm-project/issues/80807.
>From 1a9dadba40481e50a7b369ecf9b65979d093552c Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Fri, 23 Feb 2024 08:45:43 -0800
Subject: [PATCH] [flang] Fix "suspicious condition" in C++ usage
Address a reported C++ coding "suspicious condition".
Fixes https://github.com/llvm/llvm-project/issues/80807.
---
flang/lib/Semantics/data-to-inits.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flang/lib/Semantics/data-to-inits.cpp b/flang/lib/Semantics/data-to-inits.cpp
index c12af1bb0165cd..fa22d498679053 100644
--- a/flang/lib/Semantics/data-to-inits.cpp
+++ b/flang/lib/Semantics/data-to-inits.cpp
@@ -524,7 +524,7 @@ static const DerivedTypeSpec *HasDefaultInitialization(const Symbol &symbol) {
directs.begin(), directs.end(), [](const Symbol &component) {
return !IsAllocatable(component) &&
HasDeclarationInitializer(component);
- })) {
+ }) != directs.end()) {
return derived;
}
}
More information about the flang-commits
mailing list