From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17744 invoked by alias); 22 Jan 2010 11:27:32 -0000 Received: (qmail 17691 invoked by uid 48); 22 Jan 2010 11:27:22 -0000 Date: Fri, 22 Jan 2010 11:27:00 -0000 Subject: [Bug c++/42844] New: const variable requires initializer / no explicitly declared default constructor X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "mathieu dot malaterre at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-01/txt/msg02717.txt.bz2 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