<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - missing return value"
   href="http://llvm.org/bugs/show_bug.cgi?id=15688">15688</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>missing return value
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>drivehappy@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10303" name="attach_10303" title="Reproduce source code">attachment 10303</a> <a href="attachment.cgi?id=10303&action=edit" title="Reproduce source code">[details]</a></span>
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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>