<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 --- - function declared as returning value but not returning a value results in SIGILL when executed"
   href="http://llvm.org/bugs/show_bug.cgi?id=17375">17375</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>function declared as returning value but not returning a value results in SIGILL when executed
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>jorgensen@lowtechsolutions.net
          </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=11282" name="attach_11282" title="c++ source demonstrating the problem, preprocessed">attachment 11282</a> <a href="attachment.cgi?id=11282&action=edit" title="c++ source demonstrating the problem, preprocessed">[details]</a></span>
c++ source demonstrating the problem, preprocessed

The following code, built against libstdc++ 4.7.3 results in SIGILL:

#include <future>

int main()
{
        std::promise<int> promise;
        (void) promise.get_future();
}

It turns out there's a bug in libstdc++ (include/future):

      template<typename _Tp>
        static bool
        _S_check(const shared_ptr<_Tp>& __p)
        {
          if (!static_cast<bool>(__p))
            __throw_future_error((int)future_errc::no_state);
        }

the function doesn't return a value, but resulting in a SIGILL at runtime
doesn't seem like the best outcome. This bug may be the same as 16071 however
the comments there say that this problem is noted at compile-time by a warning
that is enabled by default. However I compiled with clang++ out of svn right
now and I got no such warning, no warnings at all in fact. Try it yourself:

clang++ -std=c++11 -g -o tester preprocessed.cpp

I've attached the (lzma-compressed) preprocessed source from above just to make
it easy.</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>