This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/55120] Inaccessible virtual base constructor does not prevent generation of default constructor
- From: "ndkrempel at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Oct 2012 22:41:48 +0000
- Subject: [Bug c++/55120] Inaccessible virtual base constructor does not prevent generation of default constructor
- Auto-submitted: auto-generated
- References: <bug-55120-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55120
--- Comment #4 from Nick Krempel <ndkrempel at gmail dot com> 2012-10-29 22:41:48 UTC ---
I think the standard is unclear on this. That defect report has been queried by
experts.
It comes down to something subtle about how the generated default constructor
attempts to refer to the virtual base - whether there is some kind of name
lookup of the virtual base itself going on, or whether it just 'knows' what the
right class is so that the only lookup is for the default constructor *within*
the virtual base class.
See Johannes Schaub's answer at http://stackoverflow.com/a/2371368/1395057 for
more along these lines, arguing that the current GCC behavior is in fact
correct. For what it's worth, I tend to agree with GCC's current behavior (and
it seems more useful too.)