This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/71484] New: Class with implicit public constructor triggers `-Wctor-dtor-privacy`
- From: "kyle.strand at beckman dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Jun 2016 21:10:41 +0000
- Subject: [Bug c++/71484] New: Class with implicit public constructor triggers `-Wctor-dtor-privacy`
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71484
Bug ID: 71484
Summary: Class with implicit public constructor triggers
`-Wctor-dtor-privacy`
Product: gcc
Version: 5.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: kyle.strand at beckman dot com
Target Milestone: ---
A class whose only user-declared methods are `private`, but which *does* have
an implicit public constructor, can trigger `-Wctor-dtor-privacy`.
See http://stackoverflow.com/q/33157248/1858225 for discussion and sample code.
The offending code is copied here for convenience:
struct foo
{
private:
static int test(void) { return 3; };
};