public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mathieu dot malaterre at gmail dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/42844] New: const variable requires initializer / no explicitly declared default constructor Date: Fri, 22 Jan 2010 11:27:00 -0000 [thread overview] Message-ID: <bug-42844-9357@http.gcc.gnu.org/bugzilla/> (raw) 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
next reply other threads:[~2010-01-22 11:27 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2010-01-22 11:27 mathieu dot malaterre at gmail dot com [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-42844-9357@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).