mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 11:26:02 +03:00
Fix DMD Issue 12045 - Destructor call omitted for NRVO'd struct in exceptional case
Destructor calls are correctly created by frontend and we don't need additional checks.
This commit is contained in:
parent
2214728efd
commit
030a4b1a66
1 changed files with 0 additions and 18 deletions
|
@ -279,24 +279,6 @@ public:
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void visit(DtorExpStatement *stmt) LLVM_OVERRIDE {
|
|
||||||
assert(irs->func());
|
|
||||||
FuncDeclaration *fd = irs->func()->decl;
|
|
||||||
assert(fd);
|
|
||||||
if (fd->nrvo_can && fd->nrvo_var == stmt->var)
|
|
||||||
/* Do not call destructor, because var is returned as the nrvo variable.
|
|
||||||
* This is done at this stage because nrvo can be turned off at a
|
|
||||||
* very late stage in semantic analysis.
|
|
||||||
*/
|
|
||||||
;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
visit(static_cast<ExpStatement *>(stmt));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void visit(IfStatement *stmt) LLVM_OVERRIDE {
|
void visit(IfStatement *stmt) LLVM_OVERRIDE {
|
||||||
IF_LOG Logger::println("IfStatement::toIR(): %s", stmt->loc.toChars());
|
IF_LOG Logger::println("IfStatement::toIR(): %s", stmt->loc.toChars());
|
||||||
LOG_SCOPE;
|
LOG_SCOPE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue