public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/50965] New: C++11 Non static member initializer are not run when class is initialized with {}
@ 2011-11-02 17:31 ogoffart at kde dot org
  2011-11-02 17:33 ` [Bug c++/50965] " ogoffart at kde dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: ogoffart at kde dot org @ 2011-11-02 17:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50965

             Bug #: 50965
           Summary: C++11 Non static member initializer are not run when
                    class is initialized with {}
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ogoffart@kde.org


Using g++ (GCC) 4.7.0 20111031 (experimental)


struct A { int i = 42; };
int main() {
   A a{};
   std::cout << a.i << std::endl; // shows 0
   std::cout << A{}.i << std::endl; // shows 0
}


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-11-04 17:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-02 17:31 [Bug c++/50965] New: C++11 Non static member initializer are not run when class is initialized with {} ogoffart at kde dot org
2011-11-02 17:33 ` [Bug c++/50965] " ogoffart at kde dot org
2011-11-02 17:42 ` pinskia at gcc dot gnu.org
2011-11-02 17:43 ` pinskia at gcc dot gnu.org
2011-11-02 18:13 ` paolo.carlini at oracle dot com
2011-11-04 17:16 ` jason at gcc dot gnu.org
2011-11-04 17:17 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).