[LLVMbugs] [Bug 7797] New: ICE when asked to produce template function pointer
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Tue Aug 3 04:10:38 PDT 2010
http://llvm.org/bugs/show_bug.cgi?id=7797
Summary: ICE when asked to produce template function pointer
Product: clang
Version: 2.7
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
AssignedTo: unassignedclangbugs at nondot.org
ReportedBy: trash at phoyd.net
CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
clang++ 2.7. produces an ICE when resolving a function pointer to a template
function. My minimal example is this:
----------------------------------------------
$ /opt/clang+llvm-2.7-x86_64-linux/bin/clang++ -v
clang version 1.1 (branches/release_27)
Target: x86_64-unknown-linux-gnu
Thread model: posix
$uname -a
Linux oblomow 2.6.31.12-0.2-desktop #1 SMP PREEMPT 2010-03-16 21:25:39 +0100
x86_64 x86_64 x86_64 GNU/Linux
$ cat t.cc
template<typename T>
class E {};
template<typename T>
E<T> e() ;
int main ()
{
E<int>(*f)()=e<int>;
}
$ /opt/clang+llvm-2.7-x86_64-linux/bin/clang++ gr.cc
clang: Instructions.cpp:1110: void llvm::StoreInst::AssertOK(): Assertion
`getOperand(0)->getType() ==
cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a
pointer to Val type!"' failed.
0 clang 0x000000000118601f
1 clang 0x000000000118682d
2 libpthread.so.0 0x00007fe74f2b9c00
3 libc.so.6 0x00007fe74e6084e5 gsignal + 53
4 libc.so.6 0x00007fe74e6099b0 abort + 384
5 libc.so.6 0x00007fe74e60124a __assert_fail + 234
6 clang 0x00000000010e3071
7 clang 0x000000000055e5f8
8 clang 0x000000000055324c
9 clang 0x0000000000553e3c
10 clang 0x00000000005c3bb0
11 clang 0x00000000005ca0de
12 clang 0x00000000005c77cc
13 clang 0x00000000005c9e40
14 clang 0x00000000005ca127
15 clang 0x00000000005c77cc
16 clang 0x00000000005eb089
17 clang 0x00000000005114b9
18 clang 0x0000000000511d54
19 clang 0x0000000000512025
20 clang 0x0000000000512380
21 clang 0x0000000000508d81
22 clang 0x0000000000410ab4
23 clang 0x00000000005fc655
24 clang 0x0000000000415da9
25 clang 0x00000000004095d9
26 clang 0x000000000040bf9b main + 1675
27 libc.so.6 0x00007fe74e5f4a7d __libc_start_main + 253
28 clang 0x00000000004070a9
Stack dump:
0. Program arguments: /opt/clang+llvm-2.7-x86_64-linux/bin/clang -cc1
-triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name t.cc
-mrelocation-model static -mdisable-fp-elim -mconstructor-aliases
-munwind-tables -target-cpu x86-64 -resource-dir
/opt/clang+llvm-2.7-x86_64-linux/lib/clang/1.1 -fmessage-length 149
-fexceptions -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-dJJd3e.s -x c++ t.cc
1. <eof> parser at end of file
2. t.cc:8:5: LLVM IR generation of declaration 'main'
3. t.cc:8:5: Generating code for declaration 'main'
4. t.cc:9:1: LLVM IR generation of compound statement ('{}')
clang: error: compiler command failed due to signal 6 (use -v to see
invocation)
----------------------------------------------
Cheers.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list