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++/48930] [C++0x] Invalid implicitly declared default c'tor


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.


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