<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 --- - clang++ crashes on std::function assignment lambda"
   href="http://llvm.org/bugs/show_bug.cgi?id=15477">15477</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang++ crashes on std::function assignment lambda
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.0
          </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>c664595@rmqkr.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>Compiling the following code crashes clang++ 3.0 :

$ cat tumble.cpp 
#include <functional>

struct server
{
    server()
    {
        onopen = [](){};
    }

    std::function<void ()> onopen;
};

int main()
{
}
$ clang++ -v
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix
$ clang++ -std=c++0x tumble.cpp
0  libLLVM-3.0.so.1 0x00007f3b0b1fffcf
1  libLLVM-3.0.so.1 0x00007f3b0b200591
2  libpthread.so.0  0x00007f3b0a189cb0
3  clang            0x000000000093beea clang::Sema::BuildBinOp(clang::Scope*,
clang::SourceLocation, clang::BinaryOperatorKind, clang::Expr*, clang::Expr*) +
74
4  clang            0x000000000093c17e clang::Sema::ActOnBinOp(clang::Scope*,
clang::SourceLocation, clang::tok::TokenKind, clang::Expr*, clang::Expr*) + 110
5  clang            0x000000000080f77f
clang::Parser::ParseRHSOfBinaryExpression(clang::ActionResult<clang::Expr*,
true>, clang::prec::Level) + 431
6  clang            0x000000000080fe9f
clang::Parser::ParseAssignmentExpression() + 47
7  clang            0x0000000000810c59 clang::Parser::ParseExpression() + 9
8  clang            0x00000000007d35f2
clang::Parser::ParseExprStatement(clang::ParsedAttributes&) + 50
9  clang            0x00000000007cfe18
clang::Parser::ParseStatementOrDeclaration(clang::ASTOwningVector<clang::Stmt*,
32u>&, bool) + 2616
10 clang            0x00000000007cca11
clang::Parser::ParseCompoundStatementBody(bool) + 417
11 clang            0x00000000007cd6fa
clang::Parser::ParseFunctionStatementBody(clang::Decl*,
clang::Parser::ParseScope&) + 138
12 clang            0x00000000007e98d9
clang::Parser::ParseLexedMethodDef(clang::Parser::LexedMethod&) + 601
13 clang            0x00000000007e9609
clang::Parser::ParseLexedMethodDefs(clang::Parser::ParsingClass&) + 121
14 clang            0x0000000000807dc7
clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, unsigned int,
clang::Decl*) + 2407
15 clang            0x0000000000808f2b
clang::Parser::ParseClassSpecifier(clang::tok::TokenKind,
clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo
const&, clang::AccessSpecifier, bool) + 3275
16 clang            0x00000000007f78f1
clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&,
clang::Parser::ParsedTemplateInfo const&, clang::AccessSpecifier,
clang::Parser::DeclSpecContext) + 593
17 clang            0x00000000007e2c39
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsingDeclSpec&,
clang::AccessSpecifier) + 89
18 clang            0x00000000007e32e6
clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&,
clang::AccessSpecifier) + 678
19 clang            0x00000000007e4ead
clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&,
clang::Parser::ParsingDeclSpec*) + 2685
20 clang            0x00000000007e5417
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) + 167
21 clang            0x00000000007bcbfd clang::ParseAST(clang::Sema&, bool) +
269
22 clang            0x00000000006a6253 clang::CodeGenAction::ExecuteAction() +
51
23 clang            0x00000000005adc7f
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 319
24 clang            0x000000000059653a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1114
25 clang            0x000000000058e1c4 cc1_main(char const**, char const**,
char const*, void*) + 820
26 clang            0x000000000058cb3c main + 620
27 libc.so.6        0x00007f3b098c676d __libc_start_main + 237
28 clang            0x000000000058dd39
Stack dump:
0.    Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
tumble.cpp -mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.22 -momit-leaf-frame-pointer -resource-dir /usr/bin/../lib/clang/3.0
-fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem
/usr/include/c++/4.6 -internal-isystem /usr/include/c++/4.6/x86_64-linux-gnu
-internal-isystem /usr/include/c++/4.6/backward -internal-isystem
/usr/local/include -internal-isystem /usr/bin/../lib/clang/3.0/include
-internal-externc-isystem /usr/include/x86_64-linux-gnu
-internal-externc-isystem /usr/include -std=c++0x -fdeprecated-macro
-ferror-limit 19 -fmessage-length 182 -fgnu-runtime -fobjc-runtime-has-arc
-fobjc-runtime-has-weak -fobjc-fragile-abi -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/tumble-iWs1QC.o -x c++
tumble.cpp 
1.    tumble.cpp:7:18: current parser token ';'
2.    tumble.cpp:3:1: parsing struct/union/class body 'server'
3.    tumble.cpp:6:2: parsing function body 'server'
4.    tumble.cpp:6:2: in compound statement ('{}')
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal 2 (use -v to see
invocation)
clang: note: diagnostic msg: Please submit a bug report to
<a href="http://llvm.org/bugs/">http://llvm.org/bugs/</a> and include command line arguments and all diagnostic
information.
clang: note: diagnostic msg: Preprocessed source(s) are located at:
clang: note: diagnostic msg: /tmp/tumble-6idLFq.ii</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>