Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destructors not called for temporaries created during array initialization #32387

Closed
TNorthover opened this issue May 15, 2017 · 1 comment
Closed
Labels
bugzilla Issues migrated from bugzilla c++ duplicate Resolved as duplicate

Comments

@TNorthover
Copy link
Contributor

Bugzilla Link 33040
Resolution DUPLICATE
Resolved on May 15, 2017 08:59
Version trunk
OS Linux
CC @DougGregor,@zygoloid

Extended Description

Spotted by Adam Nowacki, and it certainly looks dodgy to me. Only one of the objects gets destroyed in the following code:

#include <stdio.h>
struct A {
~A() {
printf("Destroying\n");
}
};
A make_a() {
return A();
}
struct B {
B(A a = make_a()) {};
};

int main() {
B b[5] = {};
}

@zygoloid
Copy link
Mannequin

zygoloid mannequin commented May 15, 2017

*** This bug has been marked as a duplicate of bug #23251 ***

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++ duplicate Resolved as duplicate
Projects
None yet
Development

No branches or pull requests

1 participant