<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 --- - Clang fails to diagnose (ICE: segfault) taking address of a destructor"
href="http://llvm.org/bugs/show_bug.cgi?id=16892">16892</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang fails to diagnose (ICE: segfault) taking address of a destructor
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ainsaar@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following input (test.cpp),...
struct S{};
void (S::*f)() = &S::~S;
... when run through "clang++ test.cpp", gives a segmentation fault with the
following backtrace. GCC, on the other hand, gives a correct error message
("error: taking address of destructor ‘S::~S’").
0 libLLVM-3.3.so 0x00007fc812c107e2 llvm::sys::PrintStackTrace(_IO_FILE*) +
34
1 libLLVM-3.3.so 0x00007fc812c10639
2 libpthread.so.0 0x0000003e15410bf0
3 clang 0x000000000085acd0
clang::CodeGen::CodeGenFunction::EmitDeleteCall(clang::FunctionDecl const*,
llvm::Value*, clang::QualType) + 32
4 clang 0x0000000000802279
5 clang 0x000000000080f79f
6 clang 0x0000000000810799
clang::CodeGen::CodeGenFunction::PopCleanupBlock(bool, clang::SourceLocation) +
3289
7 clang 0x0000000000809112
clang::CodeGen::CodeGenFunction::EmitDestructorBody(clang::CodeGen::FunctionArgList&)
+ 242
8 clang 0x00000000007a1e00
clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl,
llvm::Function*, clang::CodeGen::CGFunctionInfo const&) + 1616
9 clang 0x00000000007f38c3
clang::CodeGen::CodeGenModule::EmitCXXDestructor(clang::CXXDestructorDecl
const*, clang::CXXDtorType) + 163
10 clang 0x00000000007b3241
clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl) + 465
11 clang 0x00000000007b4a70
clang::CodeGen::CodeGenModule::EmitDeferred() + 144
12 clang 0x00000000007b4aa9 clang::CodeGen::CodeGenModule::Release()
+ 9
13 clang 0x000000000079119b
14 clang 0x00000000008eba52 clang::ParseAST(clang::Sema&, bool, bool)
+ 514
15 clang 0x00000000006414f9 clang::FrontendAction::Execute() + 185
16 clang 0x00000000006245aa
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 282
17 clang 0x000000000060e55a
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1514
18 clang 0x00000000006092e8 cc1_main(char const**, char const**, char
const*, void*) + 840
19 clang 0x00000000006082f9 main + 7385
20 libc.so.6 0x0000003e1482460d __libc_start_main + 237
21 clang 0x0000000000608e01
Stack dump:
0. Program arguments: /usr/bin/clang -cc1 -triple x86_64-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name
test.cpp -mrelocation-model static -mdisable-fp-elim -fmath-errno -masm-verbose
-mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64
-target-linker-version 2.23.1 -resource-dir /usr/bin/../lib/clang/3.3
-internal-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/x86_64-pc-linux-gnu
-internal-isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/include/g++-v4/backward
-internal-isystem /usr/local/include -internal-isystem
/usr/bin/../lib/clang/3.3/include -internal-externc-isystem /include
-internal-externc-isystem /usr/include -fdeprecated-macro
-fdebug-compilation-dir /home/siim/prog/test -ferror-limit 19 -fmessage-length
194 -mstackrealign -fobjc-runtime=gcc -fobjc-default-synthesize-properties
-fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics
-backend-option -vectorize-loops -o /tmp/test-MqoqLb.o -x c++ test.cpp
1. <eof> parser at end of file
2. Per-file LLVM IR generation
3. test.cpp:1:10: Generating code for declaration 'S::~S'
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-pc-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>