<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:hstong@ca.ibm.com" title="hstong@ca.ibm.com">hstong@ca.ibm.com</a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Assertion failure/bad codegen: too many args w/inherited constructor from virtual base in ctor-initializer"
href="https://bugs.llvm.org/show_bug.cgi?id=34401">bug 34401</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>WORKSFORME
</td>
<td>---
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Assertion failure/bad codegen: too many args w/inherited constructor from virtual base in ctor-initializer"
href="https://bugs.llvm.org/show_bug.cgi?id=34401#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - Assertion failure/bad codegen: too many args w/inherited constructor from virtual base in ctor-initializer"
href="https://bugs.llvm.org/show_bug.cgi?id=34401">bug 34401</a>
from <span class="vcard"><a class="email" href="mailto:hstong@ca.ibm.com" title="hstong@ca.ibm.com">hstong@ca.ibm.com</a>
</span></b>
<pre>This reproduces (with a slightly different assertion) with the same
instructions as was originally provided using a build with assertions enabled:
/llvm/clang/lib/CodeGen/CGCall.cpp:4669: clang::CodeGen::RValue
clang::CodeGen::CodeGenFunction::EmitCall(const clang::CodeGen::CGFunctionInfo
&, const clang::CodeGen::CGCallee &, clang::CodeGen::ReturnValueSlot, const
clang::CodeGen::CallArgList &, llvm::CallBase **, bool, clang::SourceLocation):
Assertion `IRFuncTy == TypeFromVal' failed.
The arguments to the inherited constructor are "passed into the void".
It seems that a different symptom of the same problem is how such arguments
with non-trivial destruction fail to get destroyed when compiling for the MS
ABI.
### ONLINE COMPILER LINK:
<a href="https://godbolt.org/z/d4a5x8MYq">https://godbolt.org/z/d4a5x8MYq</a>
### SOURCE:
struct NonTriv {
NonTriv(int);
~NonTriv();
};
extern "C" void LookForThis(void);
NonTriv::~NonTriv() {
LookForThis();
}
NonTriv LookForThat(void);
struct V { V() = default; V(NonTriv); };
struct A : virtual V {
using V::V;
A() : A(LookForThat()) { }
};
struct B : A { };
void foo() { B b; }
### OPTIONS:
-target x86_64-pc-windows -emit-llvm -O -g0
### IR output (snippet):
define dso_local void @"?foo@@YAXXZ"() local_unnamed_addr #2 personality i32
(...)* @__CxxFrameHandler3 {
%1 = alloca %struct.NonTriv, align 1
%2 = getelementptr inbounds %struct.NonTriv, %struct.NonTriv* %1, i64 0, i32
0
call void @llvm.lifetime.start.p0i8(i64 1, i8* nonnull %2)
call void @"?LookForThat@@YA?AUNonTriv@@XZ"(%struct.NonTriv* nonnull
sret(%struct.NonTriv) align 1 %1)
call void @llvm.lifetime.end.p0i8(i64 1, i8* nonnull %2)
ret void
}
### OBSERVATIONS:
It appears that there is no mechanism in the above by which the NonTriv
temporary is destroyed.
Aside: I will open a GCC defect for its failure to process the side-effects of
the argument initialization.</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>