From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1748 invoked by alias); 25 Sep 2011 20:29:27 -0000 Received: (qmail 1736 invoked by uid 22791); 25 Sep 2011 20:29:26 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 25 Sep 2011 20:29:13 +0000 From: "jason at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/42844] const variable requires initializer / no explicitly declared default constructor Date: Sun, 25 Sep 2011 20:37:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: accepts-invalid X-Bugzilla-Severity: normal X-Bugzilla-Who: jason at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: fabien.chene at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2011-09/txt/msg01884.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42844 --- Comment #16 from Jason Merrill 2011-09-25 20:29:09 UTC --- Author: jason Date: Sun Sep 25 20:29:04 2011 New Revision: 179170 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=179170 Log: Core 234 - allow const objects with no initializer or user-provided default constructor if the defaulted constructor initializes all the subobjects. PR c++/20039 PR c++/42844 * class.c (default_init_uninitialized_part): New. * cp-tree.h: Declare it. * decl.c (check_for_uninitialized_const_var): Use it. * init.c (perform_member_init): Likewise. (build_new_1): Likewise. * method.c (walk_field_subobs): Likewise. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/const8.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/class.c branches/gcc-4_6-branch/gcc/cp/cp-tree.h branches/gcc-4_6-branch/gcc/cp/decl.c branches/gcc-4_6-branch/gcc/cp/init.c branches/gcc-4_6-branch/gcc/cp/method.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-object1.C branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/defaulted2.C branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/pr42844-2.C branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/pr42844.C branches/gcc-4_6-branch/gcc/testsuite/lib/prune.exp