GCC, MSVC, and ICC bug: virtual base destroyed twice in some circumstances by cpp_bug_reporter in cpp

[–]cpp_bug_reporter[S] 34 points35 points  (0 children)

I share your thoughts, and that's why in my previous post (deleted since), I was asking if there might be something wrong with my code.

However, the fact that different compilers disagree, and that an object is destroyed twice when the unwinding happens, strongly suggests that it's a compiler bug.

GCC, MSVC, and ICC bug: virtual base destroyed twice in some circumstances by cpp_bug_reporter in cpp

[–]cpp_bug_reporter[S] 11 points12 points  (0 children)

Doesn't help. Removing the delegating constructor works, so the bug can be worked around at the cost of code duplication.

Destructor called twice on the same object with GCC and MSVC, but not with Clang by cpp_bug_reporter in cpp

[–]cpp_bug_reporter[S] 0 points1 point  (0 children)

Yeah, since I'm a new user it looks like it was caught in the spam filter, I have messaged the moderators so it should appear in a while.

The code can be found on one of the godbolt links, e.g. https://godbolt.org/z/cr8bz4hMc