[flang] Add return statement to Logical opeator=.
authorDavid Truby <david.truby@arm.com>
Wed, 15 Apr 2020 11:55:42 +0000 (12:55 +0100)
committerDavid Truby <david.truby@arm.com>
Wed, 15 Apr 2020 12:18:42 +0000 (13:18 +0100)
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

flang/include/flang/Evaluate/logical.h

index 44ba30a..ba3715a 100644 (file)
@@ -29,6 +29,7 @@ public:
 
   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