[llvm-bugs] [Bug 45530] New: flang/include/flang/Evaluate/logical.h:30: missing return statement

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 14 05:23:29 PDT 2020


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: unassignedbugs at nondot.org
          Reporter: dcb314 at hotmail.com
                CC: David.Truby at arm.com, eric.schweitz at pgroup.com,
                    llvm-bugs at lists.llvm.org

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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200414/6fa87e70/attachment.html>


More information about the llvm-bugs mailing list