[flang-commits] [flang] [flang] Fix "suspicious condition" in C++ usage (PR #82790)
via flang-commits
flang-commits at lists.llvm.org
Fri Feb 23 08:48:14 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-semantics
Author: Peter Klausler (klausler)
<details>
<summary>Changes</summary>
Address a reported C++ coding "suspicious condition".
Fixes https://github.com/llvm/llvm-project/issues/80807.
---
Full diff: https://github.com/llvm/llvm-project/pull/82790.diff
1 Files Affected:
- (modified) flang/lib/Semantics/data-to-inits.cpp (+1-1)
``````````diff
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;
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/82790
More information about the flang-commits
mailing list