public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42844]  New: const variable requires initializer / no explicitly declared default constructor
@ 2010-01-22 11:27 mathieu dot malaterre at gmail dot com
  2010-01-22 11:57 ` [Bug c++/42844] " redi at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: mathieu dot malaterre at gmail dot com @ 2010-01-22 11:27 UTC (permalink / raw)
  To: gcc-bugs

I believe the following c++ code is incorrect:

struct A
{
  A(){}
};

struct B : public A
{
};

int main()
{
  const B b;
  return 0;
}

It fails with Comeau with the following error:

"ComeauTest.c", line 13: error: const variable "b" requires an initializer --
class
          "B" has no explicitly declared default constructor
    const B b;


-- 
           Summary: const variable requires initializer / no explicitly
                    declared default constructor
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mathieu dot malaterre at gmail dot com


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


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

end of thread, other threads:[~2014-02-20  8:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42844-4@http.gcc.gnu.org/bugzilla/>
2010-11-12 15:37 ` [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor fabien.chene at gmail dot com
2011-09-23 21:36 ` jason at gcc dot gnu.org
2011-09-25 20:37 ` jason at gcc dot gnu.org
2014-02-20  8:44 ` potswa at mac dot com
2010-01-22 11:27 [Bug c++/42844] New: " mathieu dot malaterre at gmail dot com
2010-01-22 11:57 ` [Bug c++/42844] " redi at gcc dot gnu dot org
2010-01-22 12:27 ` redi at gcc dot gnu dot org
2010-01-22 15:56 ` pinskia at gcc dot gnu dot org
2010-01-22 15:57 ` pinskia at gcc dot gnu dot org
2010-03-30 11:40 ` fabien dot chene at gmail dot com
2010-03-30 11:44 ` dodji at redhat dot com
2010-03-30 11:51 ` fabien dot chene at gmail dot com
2010-03-30 11:56 ` redi at gcc dot gnu dot org
2010-03-30 14:11 ` fabien dot chene at gmail dot com
2010-03-30 16:47 ` fabien dot chene at gmail dot com
2010-04-12 20:45 ` fabien dot chene at gmail dot com
2010-04-20 22:49 ` fabien dot chene at gmail dot com
2010-04-27 18:56 ` jason at gcc dot gnu dot 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).