This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/54812] [C++11] Delete expression doesn't respect access of defaulted destructor


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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]