Skip to content

Commit

Permalink
[flang] Add return statement to Logical opeator=.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DavidTruby committed Apr 15, 2020
1 parent a688a70 commit 29e71ce
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flang/include/flang/Evaluate/logical.h
Expand Up @@ -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
Expand Down

0 comments on commit 29e71ce

Please sign in to comment.