<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 --- - Using declval on a lambda in trailing return type crashes compiler"
   href="http://llvm.org/bugs/show_bug.cgi?id=17675">17675</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using declval on a lambda in trailing return type crashes compiler
          </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>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++11
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>adam.antonik@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>This is nonsense code, but causes a crash:
#include <utility>
template <class A> auto a(A) -> decltype(std::declval<[](){}>) {}
int main() {a(0);}

Backtrace:


non-canonical or dependent type in IR-generation
UNREACHABLE executed at
/home/adam/llvm/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:93!
0  libLLVM-3.4svn.so 0x00007fe4bbbafe65 llvm::sys::PrintStackTrace(_IO_FILE*) +
37
1  libLLVM-3.4svn.so 0x00007fe4bbbb02b3
2  libpthread.so.0   0x00007fe4bace3cb0
3  libc.so.6         0x00007fe4b9b05425 gsignal + 53
4  libc.so.6         0x00007fe4b9b08b8b abort + 379
5  libLLVM-3.4svn.so 0x00007fe4bbb9d9d8 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 440
6  clang             0x000000000073d807
clang::CodeGen::CodeGenFunction::getEvaluationKind(clang::QualType) + 183
7  clang             0x00000000007cbd54
clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*,
clang::CodeGen::AggValueSlot, bool) + 36
8  clang             0x00000000007cbd29
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) + 57
9  clang             0x000000000072d0aa
clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*) + 266
10 clang             0x00000000007335cb
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot) + 91
11 clang             0x0000000000740c9f
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 783
12 clang             0x000000000074b9d2
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl)
+ 674
13 clang             0x000000000074916f
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 239
14 clang             0x000000000074ac87
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) + 791
15 clang             0x000000000074d612
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) + 1202
16 clang             0x00000000006ff1af
17 clang             0x00000000006fe5b6
18 clang             0x0000000000865353 clang::ParseAST(clang::Sema&, bool,
bool) + 435
19 clang             0x00000000006fdce2 clang::CodeGenAction::ExecuteAction() +
514
20 clang             0x0000000000579b01 clang::FrontendAction::Execute() + 113
21 clang             0x000000000055745d
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 909
22 clang             0x000000000053e095
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3029
23 clang             0x0000000000535d69 cc1_main(char const**, char const**,
char const*, void*) + 569
24 clang             0x000000000053c055 main + 8517
25 libc.so.6         0x00007fe4b9af076d __libc_start_main + 237
26 clang             0x0000000000535a6d
Stack dump:
0.      Program arguments:
/home/adam/llvm/build/Release+Debug+Asserts/bin/clang -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
cpp11.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version 2.22 -resource-dir
/home/adam/llvm/build/Release+Debug+Asserts/bin/../lib/clang/3.4
-internal-isystem /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/x86_64-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/backward
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/x86_64-linux-gnu/c++/4.6
-internal-isystem /usr/local/include -internal-isystem
/home/adam/llvm/build/Release+Debug+Asserts/bin/../lib/clang/3.4/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/adam/test
-ferror-limit 19 -fmessage-length 363 -mstackrealign -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-vectorize-slp -o /tmp/cpp11-0bd6a7.o -x c++ cpp11.cpp 
1.      <eof> parser at end of file
2.      cpp11.cpp:3:5: LLVM IR generation of declaration 'main'
3.      cpp11.cpp:3:5: Generating code for declaration 'main'
clang: error: unable to execute command: Aborted (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.4 (trunk 192895) (llvm/trunk 192886)
Target: x86_64-unknown-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>