http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52541

             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: unassig...@gcc.gnu.org
        ReportedBy: konrad_rudo...@hotmail.com


g++ 4.6.2 compiles the attached code without error. However, it *should* yield
an error similar to "uninitialized const ‘a’" (according to §8.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 issue an
error once the class `c` contains member variables.

System: OS X 10.7.3

Configured with: ../configure --prefix=MASKED
--with-gmp=/usr/local/Cellar/gmp/5.0.2/lib/
--with-mpfr=/usr/local/Cellar/mpfr/3.1.0/lib
--with-mpc=/usr/local/Cellar/libmpc/0.9/lib --program-suffix=4.6.2
--enable-languages=c,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.

Reply via email to