<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 --- - Segfault when using a variable template initialized by a lambda inside a lambda"
   href="http://llvm.org/bugs/show_bug.cgi?id=20046">20046</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault when using a variable template initialized by a lambda inside a lambda
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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++1y
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ldionne.2@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>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=12661" name="attach_12661" title="Test cases with comments">attachment 12661</a> <a href="attachment.cgi?id=12661&action=edit" title="Test cases with comments">[details]</a></span>
Test cases with comments

Hi,

The following code causes a segmentation fault on Clang r210972:
------------------------------------------------------------------------------
template <typename ...Anything>
auto variable_template = [] { return 1; }();

int main() {
    auto f = [](auto) { return variable_template<>; };
    f(1);
}
------------------------------------------------------------------------------

The error message is (no stack trace; see the attached test cases):
------------------------------------------------------------------------------
clang-3.5: error: unable to execute command: Segmentation fault: 11
clang-3.5: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.5.0
Target: x86_64-apple-darwin13.2.0
Thread model: posix
clang-3.5: note: diagnostic msg: PLEASE submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include the crash backtrace, preprocessed source, and
associated run script.
clang-3.5: note: diagnostic msg:
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-3.5: note: diagnostic msg:
/var/folders/1t/g6fmf1h52nq1b6k9gnv600xc0000gn/T/worksheet-07b61d.cpp
clang-3.5: note: diagnostic msg:
/var/folders/1t/g6fmf1h52nq1b6k9gnv600xc0000gn/T/worksheet-07b61d.sh
clang-3.5: note: diagnostic msg:

********************
------------------------------------------------------------------------------

The exact command line is:
~/code/llvm/build/bin/clang++ -std=c++1y -o /dev/null
~/desktop/bugreport/worksheet.cpp

I also attached a couple of test cases with comments.


Regards,
Louis Dionne</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>