<html>
    <head>
      <base href="https://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 --- - Segmentation fault on invalid code on x86_64-linux-gnu with "-std=c++11""
   href="https://llvm.org/bugs/show_bug.cgi?id=28305">28305</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault on invalid code on x86_64-linux-gnu with "-std=c++11"
          </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>Windows NT
          </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>-New Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$: clang++-trunk -v
clang version 3.9.0 (trunk 272938) (llvm/trunk 272936)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9.2
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.2
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$: 
$: clang++-trunk -std=c++11 small.C
small.C:3:5: error: function cannot return function type 'decltype(abort)' (aka
'void ()')
  [](int)->decltype (abort) {
    ^
#0 0x0000000001c6b8b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-3.9+0x1c6b8b5)
#1 0x0000000001c69776 llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-3.9+0x1c69776)
#2 0x0000000001c69994 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-3.9+0x1c69994)
#3 0x00007f362d18d8d0 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0xf8d0)
#4 0x00000000028c6a90 clang::Sema::CheckParmsForFunctionDef(clang::ParmVarDecl*
const*, clang::ParmVarDecl* const*, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x28c6a90)
#5 0x0000000002ada78c clang::Sema::startLambdaDefinition(clang::CXXRecordDecl*,
clang::SourceRange, clang::TypeSourceInfo*, clang::SourceLocation,
llvm::ArrayRef<clang::ParmVarDecl*>, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x2ada78c)
#6 0x0000000002c4bfd9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformLambdaExpr(clang::LambdaExpr*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c4bfd9)
#7 0x0000000002c4d7d4 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformExpr(clang::Expr*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c4d7d4)
#8 0x0000000002c5fed9 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c5fed9)
#9 0x0000000002c60bdc clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*,
bool) (/usr/local/clang-trunk/bin/clang-3.9+0x2c60bdc)
#10 0x0000000002c60ceb clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformCompoundStmt(clang::CompoundStmt*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c60ceb)
#11 0x0000000002c5ff63 clang::TreeTransform<(anonymous
namespace)::TemplateInstantiator>::TransformStmt(clang::Stmt*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c5ff63)
#12 0x0000000002c64048 clang::Sema::SubstStmt(clang::Stmt*,
clang::MultiLevelTemplateArgumentList const&)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c64048)
#13 0x0000000002c867fc
clang::Sema::InstantiateFunctionDefinition(clang::SourceLocation,
clang::FunctionDecl*, bool, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c867fc)
#14 0x0000000002c85017 clang::Sema::PerformPendingInstantiations(bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x2c85017)
#15 0x000000000288c50f clang::Sema::ActOnEndOfTranslationUnit()
(/usr/local/clang-trunk/bin/clang-3.9+0x288c50f)
#16 0x00000000026a1961
clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)
(/usr/local/clang-trunk/bin/clang-3.9+0x26a1961)
#17 0x000000000269c16b clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-3.9+0x269c16b)
#18 0x000000000236afbb clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-3.9+0x236afbb)
#19 0x000000000209aa4e clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-3.9+0x209aa4e)
#20 0x0000000002071526
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-3.9+0x2071526)
#21 0x0000000002123942
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-3.9+0x2123942)
#22 0x0000000000b0eba8 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-3.9+0xb0eba8)
#23 0x0000000000ac3325 main (/usr/local/clang-trunk/bin/clang-3.9+0xac3325)
#24 0x00007f362c3b7b45 __libc_start_main
(/lib/x86_64-linux-gnu/libc.so.6+0x21b45)
#25 0x0000000000b0ad04 _start (/usr/local/clang-trunk/bin/clang-3.9+0xb0ad04)
Stack dump:
0.    Program arguments: /usr/local/clang-trunk/bin/clang-3.9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
small.C -mrelocation-model static -mthread-model posix -mdisable-fp-elim
-fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables
-fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb
-resource-dir /usr/local/clang-trunk/bin/../lib/clang/3.9.0 -c-isystem .
-c-isystem /usr/local/include/csmith -internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/clang-trunk/bin/../lib/clang/3.9.0/include -internal-externc-isystem
/usr/include/x86_64-linux-gnu -internal-externc-isystem /include
-internal-externc-isystem /usr/include -std=c++11 -fdeprecated-macro
-fdebug-compilation-dir
/home/cnsun/workspace/meta-compiler/error-fuzzer/temp-runs/IdentifierSubstituionFuzzingEngine/crash/20160621-clang++-trunk--O3-c-Weverything-std=c++14-build-051707
-ferror-limit 19 -fmessage-length 132 -fobjc-runtime=gcc -fcxx-exceptions
-fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/small-366559.o -x c++ small.C 
1.    <eof> parser at end of file
2.    small.C:2:27: instantiating function definition 'f<int>'
clang-3.9: error: unable to execute command: Segmentation fault
clang-3.9: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.9.0 (trunk 272938) (llvm/trunk 272936)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang-3.9: 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.9: 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.9: note: diagnostic msg: /tmp/small-724233.cpp
clang-3.9: note: diagnostic msg: /tmp/small-724233.sh
clang-3.9: note: diagnostic msg: 

********************
$: 
$: cat small.C
void abort ();
template < class T > void f (T) {
  [](int)->decltype (abort) {
  };
}

int main () {
  f (5);
  return 0;
}
$:</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>