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

            Bug ID: 45530
           Summary: flang/include/flang/Evaluate/logical.h:30: missing
                    return statement
           Product: flang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Fortran IR
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

flang/include/flang/Evaluate/logical.h:30:47: error: No 'return' statement in
non-void function causes undefined behavior. 

Source code is

 template <int B, bool C> constexpr Logical &operator=(Logical<B, C> x) {
    word_ = Represent(x.IsTrue());
  }

Maybe better code

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to