[flang-commits] [flang] 29e71ce - [flang] Add return statement to Logical opeator=.

David Truby via flang-commits flang-commits at lists.llvm.org
Wed Apr 15 05:18:57 PDT 2020


Author: David Truby
Date: 2020-04-15T13:18:42+01:00
New Revision: 29e71ceaee1a7a27d194100f0d94eb4d49496529

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

LOG: [flang] Add return statement to Logical opeator=.

This removes the current undefined behavior where the function has a return type
but no return statement.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=45530

Added: 
    

Modified: 
    flang/include/flang/Evaluate/logical.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Evaluate/logical.h b/flang/include/flang/Evaluate/logical.h
index 44ba30ae6e17..ba3715a7e46b 100644
--- a/flang/include/flang/Evaluate/logical.h
+++ b/flang/include/flang/Evaluate/logical.h
@@ -29,6 +29,7 @@ template <int BITS, bool IS_LIKE_C = true> class Logical {
 
   template <int B, bool C> constexpr Logical &operator=(Logical<B, C> x) {
     word_ = Represent(x.IsTrue());
+    return *this;
   }
 
   // Fortran actually has only .EQV. & .NEQV. relational operations


        


More information about the flang-commits mailing list