From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28030 invoked by alias); 13 Sep 2006 03:00:14 -0000 Received: (qmail 27990 invoked by uid 48); 13 Sep 2006 03:00:05 -0000 Date: Wed, 13 Sep 2006 03:00:00 -0000 Message-ID: <20060913030005.27989.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/29043] Constructor for POD type with const member without member initializer accepted In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fang at csl dot cornell dot edu" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-09/txt/msg01141.txt.bz2 List-Id: ------- Comment #1 from fang at csl dot cornell dot edu 2006-09-13 03:00 ------- As you've written it, class C doesn't have any non-static members. Struct C::s hasn't been declared as a member object of C. const int i is a member of C::s, not C, so C() without member initializers should be acceptable. Note, if you write just : struct s { const int i; }; // This, however, doesn't give any diagnostics until an instance of s is declared. s foo; struct.cc:7: error: structure 'foo' with uninitialized const members Now, I'd need to lookup the standard to determine whether or not a diagnostic is appropriate... -- fang at csl dot cornell dot edu changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fang at csl dot cornell dot | |edu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29043