[flang-commits] [flang] e8a9aa2 - [flang] Fix "suspicious condition" in C++ usage (#82790)

via flang-commits flang-commits at lists.llvm.org
Fri Mar 1 15:46:16 PST 2024


Author: Peter Klausler
Date: 2024-03-01T15:46:12-08:00
New Revision: e8a9aa26f708ec59cb3a0c37767817c069fb12f0

URL: https://github.com/llvm/llvm-project/commit/e8a9aa26f708ec59cb3a0c37767817c069fb12f0
DIFF: https://github.com/llvm/llvm-project/commit/e8a9aa26f708ec59cb3a0c37767817c069fb12f0.diff

LOG: [flang] Fix "suspicious condition" in C++ usage (#82790)

Address a reported C++ coding "suspicious condition".

Fixes https://github.com/llvm/llvm-project/issues/80807.

Added: 
    

Modified: 
    flang/lib/Semantics/data-to-inits.cpp

Removed: 
    


################################################################################
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