This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/52541] New: g++ allows definition of const POD


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: unassigned@gcc.gnu.org
        ReportedBy: konrad_rudolph@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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]