This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48930] [C++0x] Invalid implicitly declared default c'tor
- From: "schaub.johannes at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 8 May 2011 21:23:22 +0000
- Subject: [Bug c++/48930] [C++0x] Invalid implicitly declared default c'tor
- Auto-submitted: auto-generated
- References: <bug-48930-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48930
Johannes Schaub <schaub.johannes at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schaub.johannes at
| |googlemail dot com
--- Comment #1 from Johannes Schaub <schaub.johannes at googlemail dot com> 2011-05-08 21:22:20 UTC ---
I think it can be argued that this is a bug in the Standard rather than in GCC.
The Standard says that members of C are zero initialized.
It says that the default constructor is called only if it is non-trivial. Since
there is no default constructor here, there is nothing to be non-trivial. For
sure this is arguing about things that are not intended this way, but I think
non-the-less it can be argued this way.
This "special" behavior is more clear in the following case
struct C {
C() = delete;
};
C c{};
There is a default constructor, but it is not called because it's trivial.