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++/86238] No diagnostic for virtual base class with inaccessible destructor


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86238

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
            Summary|a vtable layout bug         |No diagnostic for virtual
                   |                            |base class with
                   |                            |inaccessible destructor

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please try to provide meaningful bug titles, and reduce the code to remove
everything that isn't relevant.

This bug reduces from a 72kB testcase to simply:

struct s2 { ~s2() {} };
class s3 : virtual protected s2 { };
class s4 : private s3 { };
class s11 : s4 { } a11;

C++ and EDG accept this, but Clang prints:


test.cc:4:7: error: inherited virtual base class 's2' has private destructor
class s11 : s4 { } a11;
      ^
test.cc:4:20: note: in implicit default constructor for 's11' first required
here
class s11 : s4 { } a11;
                   ^
test.cc:3:12: note: constrained by private inheritance here
class s4 : private s3 { };
           ^~~~~~~~~~
test.cc:4:7: error: inherited virtual base class 's2' has private destructor
class s11 : s4 { } a11;
      ^
test.cc:4:20: note: in implicit destructor for 's11' first required here
class s11 : s4 { } a11;
                   ^
test.cc:3:12: note: constrained by private inheritance here
class s4 : private s3 { };
           ^~~~~~~~~~
2 errors generated.

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