<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 --- - clang crashes on valid C++14 code with -std=c++11: UNREACHABLE executed at /path/to/CodeGenTypes.cpp:485!"
href="https://llvm.org/bugs/show_bug.cgi?id=31846">31846</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang crashes on valid C++14 code with -std=c++11: UNREACHABLE executed at /path/to/CodeGenTypes.cpp:485!
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>su@cs.ucdavis.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>$ clang++ -v
clang version 5.0.0 (trunk 293675)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.4
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.6.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.7.3
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.5
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.4
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.3.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.2.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
$
$ clang++ -c -std=c++14 small.cpp
$
$ clang++ -c -std=c++11 small.cpp
Unexpected placeholder builtin type!
UNREACHABLE executed at
/tmp/llvm-builder/llvm-source-trunk/tools/clang/lib/CodeGen/CodeGenTypes.cpp:485!
#0 0x00000000020720e5 llvm::sys::PrintStackTrace(llvm::raw_ostream&)
(/usr/local/clang-trunk/bin/clang-5.0+0x20720e5)
#1 0x000000000207020e llvm::sys::RunSignalHandlers()
(/usr/local/clang-trunk/bin/clang-5.0+0x207020e)
#2 0x0000000002070370 SignalHandler(int)
(/usr/local/clang-trunk/bin/clang-5.0+0x2070370)
#3 0x00007fc980455330 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x10330)
#4 0x00007fc97f241c37 gsignal
/build/eglibc-oGUzwX/eglibc-2.19/signal/../nptl/sysdeps/unix/sysv/linux/raise.c:56:0
#5 0x00007fc97f245028 abort
/build/eglibc-oGUzwX/eglibc-2.19/stdlib/abort.c:91:0
#6 0x0000000002020d1a (/usr/local/clang-trunk/bin/clang-5.0+0x2020d1a)
#7 0x00000000022cd63f
clang::CodeGen::CodeGenTypes::ConvertType(clang::QualType)
(/usr/local/clang-trunk/bin/clang-5.0+0x22cd63f)
#8 0x000000000235ae22
clang::CodeGen::CodeGenTypes::arrangeLLVMFunctionInfo(clang::CanQual<clang::Type>,
bool, bool, llvm::ArrayRef<clang::CanQual<clang::Type> >,
clang::FunctionType::ExtInfo,
llvm::ArrayRef<clang::FunctionProtoType::ExtParameterInfo>,
clang::CodeGen::RequiredArgs) (/usr/local/clang-trunk/bin/clang-5.0+0x235ae22)
#9 0x000000000235c897 arrangeLLVMFunctionInfo(clang::CodeGen::CodeGenTypes&,
bool, llvm::SmallVectorImpl<clang::CanQual<clang::Type> >&,
clang::CanQual<clang::FunctionProtoType>, clang::FunctionDecl const*)
(/usr/local/clang-trunk/bin/clang-5.0+0x235c897)
#10 0x000000000235ca64
clang::CodeGen::CodeGenTypes::arrangeCXXMethodType(clang::CXXRecordDecl const*,
clang::FunctionProtoType const*, clang::CXXMethodDecl const*)
(/usr/local/clang-trunk/bin/clang-5.0+0x235ca64)
#11 0x00000000023c0eed
clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(clang::CallExpr
const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot, bool,
clang::NestedNameSpecifier*, bool, clang::Expr const*)
(/usr/local/clang-trunk/bin/clang-5.0+0x23c0eed)
#12 0x00000000023c1952
clang::CodeGen::CodeGenFunction::EmitCXXOperatorMemberCallExpr(clang::CXXOperatorCallExpr
const*, clang::CXXMethodDecl const*, clang::CodeGen::ReturnValueSlot)
(/usr/local/clang-trunk/bin/clang-5.0+0x23c1952)
#13 0x00000000023af8d7
clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*,
clang::CodeGen::ReturnValueSlot)
(/usr/local/clang-trunk/bin/clang-5.0+0x23af8d7)
#14 0x00000000009501dc (anonymous
namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*)
(/usr/local/clang-trunk/bin/clang-5.0+0x9501dc)
#15 0x00000000023d4358 (anonymous
namespace)::ScalarExprEmitter::Visit(clang::Expr*)
(/usr/local/clang-trunk/bin/clang-5.0+0x23d4358)
#16 0x00000000023d4993
clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x23d4993)
#17 0x000000000239738f clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr
const*, clang::CodeGen::AggValueSlot, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x239738f)
#18 0x00000000023a8c9d
clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*)
(/usr/local/clang-trunk/bin/clang-5.0+0x23a8c9d)
#19 0x000000000223bbec clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt
const*) (/usr/local/clang-trunk/bin/clang-5.0+0x223bbec)
#20 0x000000000223cc3f
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
(/usr/local/clang-trunk/bin/clang-5.0+0x223cc3f)
#21 0x000000000226d242
clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::CodeGen::FunctionArgList&,
clang::Stmt const*) (/usr/local/clang-trunk/bin/clang-5.0+0x226d242)
#22 0x0000000002277fdb
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2277fdb)
#23 0x0000000002299fd1
clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/clang-trunk/bin/clang-5.0+0x2299fd1)
#24 0x00000000022a6b51
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl,
llvm::GlobalValue*) (/usr/local/clang-trunk/bin/clang-5.0+0x22a6b51)
#25 0x00000000022a7a71
clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl)
(/usr/local/clang-trunk/bin/clang-5.0+0x22a7a71)
#26 0x00000000022a8164
clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone
.part.7081] (/usr/local/clang-trunk/bin/clang-5.0+0x22a8164)
#27 0x000000000289e41b (anonymous
namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef)
(/usr/local/clang-trunk/bin/clang-5.0+0x289e41b)
#28 0x000000000289608c
clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef)
(/usr/local/clang-trunk/bin/clang-5.0+0x289608c)
#29 0x0000000002c7af2e clang::ParseAST(clang::Sema&, bool, bool)
(/usr/local/clang-trunk/bin/clang-5.0+0x2c7af2e)
#30 0x000000000289cd6a clang::CodeGenAction::ExecuteAction()
(/usr/local/clang-trunk/bin/clang-5.0+0x289cd6a)
#31 0x000000000255c3fe clang::FrontendAction::Execute()
(/usr/local/clang-trunk/bin/clang-5.0+0x255c3fe)
#32 0x0000000002532eee
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)
(/usr/local/clang-trunk/bin/clang-5.0+0x2532eee)
#33 0x00000000025f1202
clang::ExecuteCompilerInvocation(clang::CompilerInstance*)
(/usr/local/clang-trunk/bin/clang-5.0+0x25f1202)
#34 0x0000000000c2c048 cc1_main(llvm::ArrayRef<char const*>, char const*,
void*) (/usr/local/clang-trunk/bin/clang-5.0+0xc2c048)
#35 0x0000000000bca285 main (/usr/local/clang-trunk/bin/clang-5.0+0xbca285)
#36 0x00007fc97f22cf45 __libc_start_main
/build/eglibc-oGUzwX/eglibc-2.19/csu/libc-start.c:321:0
#37 0x0000000000c27ce9 _start (/usr/local/clang-trunk/bin/clang-5.0+0xc27ce9)
Stack dump:
0. Program arguments: /usr/local/clang-trunk/bin/clang-5.0 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
small.cpp -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
-coverage-notes-file /data2/small.gcno -resource-dir
/usr/local/clang-trunk/bin/../lib/clang/5.0.0 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/c++/4.9 -internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../include/x86_64-linux-gnu/c++/4.9
-internal-isystem
/usr/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/5.0.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 /data2 -ferror-limit 19 -fmessage-length 155
-fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option
-fcolor-diagnostics -o small.o -x c++ small.cpp
1. <eof> parser at end of file
2. small.cpp:1:6: LLVM IR generation of declaration 'foo'
3. small.cpp:1:6: Generating code for declaration 'foo'
clang-5.0: error: unable to execute command: Aborted (core dumped)
clang-5.0: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 5.0.0 (trunk 293675)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/local/clang-trunk/bin
clang-5.0: 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-5.0: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-5.0: note: diagnostic msg: /tmp/small-98ebf6.cpp
clang-5.0: note: diagnostic msg: /tmp/small-98ebf6.sh
clang-5.0: note: diagnostic msg:
********************
$
---------------------------
void foo ()
{
[] (auto) {} (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>