<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 segmentation fault"
   href="http://llvm.org/bugs/show_bug.cgi?id=16719">16719</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang segmentation fault
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </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>miranda.conrado@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=10939" name="attach_10939" title="MWE I could build">attachment 10939</a> <a href="attachment.cgi?id=10939&action=edit" title="MWE I could build">[details]</a></span>
MWE I could build

Find attached the minimum working example I could think. gcc version 4.6.3
provides the following message:
clang_report1.cpp: In member function ‘T1 function_broken(T1&)::<anonymous
struct>::method()’:
clang_report1.cpp:10:14: error: use of parameter from containing function
clang_report1.cpp:7:6: error:   ‘T1& value’ declared here

As I could only attach one file, the associated script
(/tmp/clang_report1-hJDYmI.cpp) is:
/usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all
-disable-free -disable-llvm-verifier -main-file-name clang_report1.cpp
-mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version
2.23.1 -std=c++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 203
-mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -x c++ clang_report1-hJDYmI.cpp

The backtrace and error messages are:
0  libLLVM-3.3.so  0x00007f12f9bb6b82 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1  libLLVM-3.3.so  0x00007f12f9bb6f40
2  libpthread.so.0 0x00007f12f9300050
3  clang           0x0000000000778901
clang::CodeGen::CodeGenFunction::GetAddrOfBlockDecl(clang::VarDecl const*,
bool) + 33
4  clang           0x00000000007c7201
clang::CodeGen::CodeGenFunction::EmitDeclRefLValue(clang::DeclRefExpr const*) +
609
5  clang           0x00000000007c795e
clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) + 766
6  clang           0x00000000007ca391
clang::CodeGen::CodeGenFunction::EmitCheckedLValue(clang::Expr const*,
clang::CodeGen::CodeGenFunction::TypeCheckKind) + 81
7  clang           0x00000000007f1441
8  clang           0x00000000007fb899
9  clang           0x000000000056add8
10 clang           0x00000000007fa613
11 clang           0x00000000007fd71d
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) + 61
12 clang           0x000000000084d27d
clang::CodeGen::CodeGenFunction::EmitReturnStmt(clang::ReturnStmt const&) + 381
13 clang           0x0000000000851ccb
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 491
14 clang           0x00000000008545d0
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 80
15 clang           0x000000000071cd71
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&)
+ 113
16 clang           0x0000000000720b88
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 488
17 clang           0x000000000073832e
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 366
18 clang           0x00000000007397dc
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 220
19 clang           0x0000000000739986
clang::CodeGen::CodeGenModule::EmitDeferred() + 166
20 clang           0x00000000007399e9 clang::CodeGen::CodeGenModule::Release()
+ 9
21 clang           0x0000000000710639
22 clang           0x000000000086e954 clang::ParseAST(clang::Sema&, bool, bool)
+ 372
23 clang           0x00000000005b2fea clang::FrontendAction::Execute() + 170
24 clang           0x0000000000595562
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 290
25 clang           0x000000000057cdc9
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1577
26 clang           0x0000000000576848 cc1_main(char const**, char const**, char
const*, void*) + 872
27 clang           0x00000000005751dd main + 605
28 libc.so.6       0x00007f12f8a4866d __libc_start_main + 237
29 clang           0x000000000057635d
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
clang_report1.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.23.1 -resource-dir /usr/bin/../lib64/clang/3.3
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib64/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++0x -fdeprecated-macro
-fdebug-compilation-dir /home/conrado/pesquisa/programs/cpp/filters
-ferror-limit 19 -fmessage-length 203 -mstackrealign -fobjc-runtime=gcc
-fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions
-fdiagnostics-show-option -fcolor-diagnostics -backend-option -vectorize-loops
-o /tmp/clang_report1-gNNdgr.o -x c++ clang_report1.cpp 
1.      <eof> parser at end of file
2.      Per-file LLVM IR generation
3.      clang_report1.cpp:9:8: Generating code for declaration
'function_broken(int &)::<anonymous struct>::method'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-pc-linux-gnu
Thread model: posix</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>