Skip to content

Commit 76eacee

Browse files
DavidTrubymemfrob
authored andcommitted
[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
1 parent e2fcf2c commit 76eacee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/include/flang/Evaluate/logical.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ template <int BITS, bool IS_LIKE_C = true> class Logical {
2929

3030
template <int B, bool C> constexpr Logical &operator=(Logical<B, C> x) {
3131
word_ = Represent(x.IsTrue());
32+
return *this;
3233
}
3334

3435
// Fortran actually has only .EQV. & .NEQV. relational operations

0 commit comments

Comments
 (0)