public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/25811]  New: No failure creating a POD containing a const member, using new without a new-initializer.
@ 2006-01-16 20:00 fabien dot chene at laposte dot net
  2006-01-16 20:06 ` [Bug c++/25811] " pinskia at gcc dot gnu dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: fabien dot chene at laposte dot net @ 2006-01-16 20:00 UTC (permalink / raw)
  To: gcc-bugs

$ cat podnew.cpp

struct Foo // POD
{
    double const d;
};

int main()
{
    Foo* foo = new Foo; // without the new-initializer
}

This simple code does not fail to compile.
According to the standard (5.3.4.15), I am not sure, but i think it should fail
to compile.

$ g++ podnew.cpp && echo "no failure"
no failure

I use gcc-4.0.2, but it is the same behaviour with 3.4.4.

$ g++ -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/gcc-4.0.2-r1/work/gcc-4.0.2/configure
--prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.0.2
--includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/include
--datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0.2
--mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0.2/man
--infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.0.2/info
--with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/include/g++-v4
--host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec
--enable-nls --without-included-gettext --with-system-zlib --disable-checking
--disable-werror --disable-libunwind-exceptions --disable-multilib
--disable-libgcj --enable-languages=c,c++,f95 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 4.0.2 (Gentoo 4.0.2-r1, pie-8.7.8)


-- 
           Summary: No failure creating a POD containing a const member,
                    using new without a new-initializer.
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fabien dot chene at laposte dot net
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <bug-25811-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-05-24 22:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-16 20:00 [Bug c++/25811] New: No failure creating a POD containing a const member, using new without a new-initializer fabien dot chene at laposte dot net
2006-01-16 20:06 ` [Bug c++/25811] " pinskia at gcc dot gnu dot org
2010-03-30  8:22 ` fabien dot chene at gmail dot com
2010-03-30  9:16 ` redi at gcc dot gnu dot org
2010-03-30 10:07 ` fabien dot chene at gmail dot com
2010-03-30 10:10 ` fabien dot chene at gmail dot com
2010-03-30 11:19 ` redi at gcc dot gnu dot org
2010-03-31  7:07 ` fabien dot chene at gmail dot com
2010-03-31  8:55 ` redi at gcc dot gnu dot org
2010-03-31 12:21 ` fabien dot chene at gmail dot com
2010-03-31 12:34 ` redi at gcc dot gnu dot org
2010-03-31 13:46 ` fabien dot chene at gmail dot com
2010-03-31 13:53 ` redi at gcc dot gnu dot org
2010-04-12 19:58 ` jason at gcc dot gnu dot org
     [not found] <bug-25811-4@http.gcc.gnu.org/bugzilla/>
2012-05-24 22:46 ` paolo.carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).