public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58328] New: [C++11] bogus: error: constructor required before non-static data member for
@ 2013-09-05 21:13 ppluzhnikov at google dot com
  2013-09-05 21:19 ` [Bug c++/58328] " paolo.carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ppluzhnikov at google dot com @ 2013-09-05 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58328
           Summary: [C++11] bogus: error: constructor required before
                    non-static data member for
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/10634418

This appears to be very similar to PR 57770

Using g++ (GCC) 4.9.0 20130904 (experimental)

cat t.cc

struct A {
  struct B {
    // B() {}  // Uncommenting this line makes it work.
    int y = 1; // Removing initializer makes it work.
  };

  A(const B& opts = B()) {}  // Removing default makes it work.
};


g++ -c t.cc -std=c++11
t.cc: In constructor 'A::B::B()':
t.cc:2:10: error: constructor required before non-static data member for
'A::B::y' has been parsed
   struct B {
          ^
t.cc: At global scope:
t.cc:7:23: note: synthesized method 'A::B::B()' first required here 
   A(const B& opts = B()) {}
                       ^


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

end of thread, other threads:[~2014-09-19  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05 21:13 [Bug c++/58328] New: [C++11] bogus: error: constructor required before non-static data member for ppluzhnikov at google dot com
2013-09-05 21:19 ` [Bug c++/58328] " paolo.carlini at oracle dot com
2013-09-05 21:26 ` ppluzhnikov at google dot com
2013-09-06  0:13 ` richard-gccbugzilla at metafoo dot co.uk
2014-09-19  9:22 ` paolo.carlini at oracle dot com
2014-09-19  9:35 ` paolo.carlini at oracle dot com

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).