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

           Summary: Missing static const symbol with -O0
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: hartmut.schir...@arcormail.de


Compiling the attached test linking fails with -O0:

d:\temp>gcc-4 --version
gcc-4 (GCC) 4.3.4 20090804 (release) 1
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


d:\temp>gcc-4 -O0 test.cpp
/cygdrive/c/Temp/ccIFKxxH.o:test.cpp:(.text+0xf): undefined reference to
`A::PEN'
/cygdrive/c/Temp/ccIFKxxH.o:test.cpp:(.text+0x1e): undefined reference to
`A::NEN'
collect2: ld returned 1 exit status

d:\temp>gcc-4 -O1 test.cpp

Also fails with gcc 4.4.2 from QNX 6.5.0

Reply via email to