From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20439 invoked by alias); 9 Mar 2012 11:08:25 -0000 Received: (qmail 20430 invoked by uid 22791); 9 Mar 2012 11:08:24 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Fri, 09 Mar 2012 11:08:11 +0000 From: "konrad_rudolph at hotmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52541] New: g++ allows definition of const POD Date: Fri, 09 Mar 2012 11:08:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: konrad_rudolph at hotmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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: 2012-03/txt/msg00730.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52541 Bug #: 52541 Summary: g++ allows definition of const POD Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: konrad_rudolph@hotmail.com g++ 4.6.2 compiles the attached code without error. However, it *should* yi= eld an error similar to "uninitialized const =E2=80=98a=E2=80=99" (according to= =C2=A78.5 of the standard). In particular, prior versions of GCC treat this as an error, suggesting a regression. It's also worth noting that the compiler does issu= e an error once the class `c` contains member variables. System: OS X 10.7.3 Configured with: ../configure --prefix=3DMASKED --with-gmp=3D/usr/local/Cellar/gmp/5.0.2/lib/ --with-mpfr=3D/usr/local/Cellar/mpfr/3.1.0/lib --with-mpc=3D/usr/local/Cellar/libmpc/0.9/lib --program-suffix=3D4.6.2 --enable-languages=3Dc,c++,fortran Command line: g++-4.6.2 -pedantic main.cpp Compiler output: none More information: http://stackoverflow.com/q/9632229/1968, in particular the discussion in the comments.