[flang-commits] [flang] 051bf9c - [Flang] fix a copy-paste error in scope.cpp

Shivam Gupta via flang-commits flang-commits at lists.llvm.org
Mon Jan 23 01:26:41 PST 2023


Author: Shivam Gupta
Date: 2023-01-23T14:57:12+05:30
New Revision: 051bf9cd76ad6f38aa9cb8d1319e68485ffcd565

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

LOG: [Flang] fix a copy-paste error in scope.cpp

found by PVS-Studio.

Reviewed By: jeanPerier, klausler

Differential Revision: https://reviews.llvm.org/D142306

Added: 
    

Modified: 
    flang/lib/Semantics/scope.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Semantics/scope.cpp b/flang/lib/Semantics/scope.cpp
index e92a21b55768a..387f8e7d4f105 100644
--- a/flang/lib/Semantics/scope.cpp
+++ b/flang/lib/Semantics/scope.cpp
@@ -272,7 +272,7 @@ std::optional<parser::MessageFixedText> Scope::SetImportKind(ImportKind kind) {
         ? "IMPORT,NONE must be the only IMPORT statement in a scope"_err_en_US
         : "IMPORT,ALL must be the only IMPORT statement in a scope"_err_en_US;
   } else if (kind != *importKind_ &&
-      (kind != ImportKind::Only || kind != ImportKind::Only)) {
+      (kind != ImportKind::Only && *importKind_ != ImportKind::Only)) {
     return "Every IMPORT must have ONLY specifier if one of them does"_err_en_US;
   } else {
     return std::nullopt;


        


More information about the flang-commits mailing list