This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/65300] If one more constructor is defined, default params on using not passed from parent class
- 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: Tue, 03 Mar 2015 16:39:24 +0000
- Subject: [Bug c++/65300] If one more constructor is defined, default params on using not passed from parent class
- Auto-submitted: auto-generated
- References: <bug-65300-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65300
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This is the same as PR 65291, but I stated the reason wrong there.
Default constructors have special rules. A constructor like C(int = 0) or
C(int = 0, int = 0) will not declare a default constructor when inherited. You
need to declare it explicitly:
C() = default;
See [class.inhctor] in the standard.