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++/65300] If one more constructor is defined, default params on using not passed from parent class


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.


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