<html>
<head>
<base href="https://bugs.llvm.org/">
</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 in Support/Casting.h"
href="https://bugs.llvm.org/show_bug.cgi?id=47204">47204</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ crashes in Support/Casting.h
</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>enhancement
</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>tangyixuan@mail.dlut.edu.cn
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Please try to compile the following code:
$: cat s.cpp
template <typename ...T> void a(T ...args1, char ...args2[][sizeof args1]) { }
template <typename T> void b(T) { }
void c() { b(&a<int>); }
$: clang++ -c s.cpp
clang-9:
/home/oscar/compiler/llvm-project/llvm/include/llvm/Support/Casting.h:264:
typename llvm::cast_retty<X, Y*>::ret_type llvm::cast(Y*) [with X =
clang::TemplateTemplateParmDecl; Y = clang::NamedDecl; typename
llvm::cast_retty<X, Y*>::ret_type = clang::TemplateTemplateParmDecl*]:
Assertion `isa<X>(Val) && "cast<Ty>() argument of incompatible type!"' failed.
Stack dump:
0. Program arguments: /usr/local/bin/clang-9 -cc1 -triple
x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -main-file-name
s.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=all
-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/lib/clang/10.0.0 -internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/x86_64-pc-linux-gnu
-internal-isystem
/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/local/lib/clang/10.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 /media/oscar/xuaner1/c++bugreprot/TEST-CRASH
-ferror-limit 19 -fmessage-length 0 -fgnuc-version=4.2.1 -fobjc-runtime=gcc
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-faddrsig -o s.o -x c++ s.cpp
1. s.cpp:3:21: current parser token ')'
2. s.cpp:3:10: parsing function body 'c'
3. s.cpp:3:10: in compound statement ('{}')
#0 0x000055f09a6c305f llvm::sys::PrintStackTrace(llvm::raw_ostream&)
/home/oscar/compiler/llvm-project/llvm/lib/Support/Unix/Signals.inc:544: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>