[LLVMbugs] [Bug 15688] New: missing return value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Apr 5 15:44:54 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=15688

            Bug ID: 15688
           Summary: missing return value
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: drivehappy at gmail.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10303
  --> http://llvm.org/bugs/attachment.cgi?id=10303&action=edit
Reproduce source code

When a function contains a missing return value when a return type is specified
the program will contain undefined results. For the attached code I receive an
"Illegal instruction" when running the executable.

The ISO C++ standard 6.6.3 does state that, "Flowing off the end of a function
is equivalent to a return with no value; this results in undefined behavior in
a value-returning function." If this is the reason clang is generating code
then I would consider it resolved. However some more diagnostics might be more
helpful, instead of the seemingly benign warning of: "missing_return.cpp:2:1:
warning: control reaches end of non-void function"

Appears in Clang 3.2 and trunk, under Debug and Release for both 32 and 64-bit
generated code.

-- 
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/20130405/4870541b/attachment.html>


More information about the llvm-bugs mailing list