This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54812] [C++11] Delete expression doesn't respect access of defaulted destructor
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 26 Jul 2013 12:35:41 +0000
- Subject: [Bug c++/54812] [C++11] Delete expression doesn't respect access of defaulted destructor
- Auto-submitted: auto-generated
- References: <bug-54812-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54812
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #3)
> Of course it should be fixed, it *must* be fixed, actually! And it's really
> annoying that this bug affecting private defaulted destructors (which, I
> bet, aren't that common for most programs not using SFINAE tricks!?!)
The bug affects protected destructors too, and they're commonly used for base
classes to prevent deletion via pointer-to-base. This bug means you can't make
them trivial by defining them as defaulted.
The problem isn't confined to delete expressions as the example from PR56429
shows:
class A
{
A() = default;
};
struct B : A { };
B b;