This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86238] No diagnostic for virtual base class with inaccessible 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: Wed, 20 Jun 2018 14:22:37 +0000
- Subject: [Bug c++/86238] No diagnostic for virtual base class with inaccessible destructor
- Auto-submitted: auto-generated
- References: <bug-86238-4@http.gcc.gnu.org/bugzilla/>
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.