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++/17155] New: Another link problem with function-local classes


$ g++ -v
Reading specs from
/data/scratch/devtools/gcc-3.5.0-pre-20040822/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: ../gcc-3.5-20040822/configure
--prefix=/data/scratch/devtools/gcc-3.5.0-pre-20040822 --enable-languages=c,c++
--with-as=/data/scratch/binutils/2.15/bin/as
--with-ld=/data/scratch/binutils/2.15/bin/ld --enable-__cxa_atexit --disable-nls
i686-pc-linux-gnu
Thread model: posix
gcc version 3.5.0 20040822 (experimental)
$ cat test.cc
struct A {
    virtual ~A() {}
};


void tsk_tsk(void)
{
    struct B : public A {
        B(int) {}
    };
}

int main() {}
$ $ g++ -W -Wall test.cc
/tmp/cccfVwjp.o(.text+0x64): In function
`__static_initialization_and_destruction_0(int, int)':
: undefined reference to `tsk_tsk()::B::~B()'
/tmp/cccfVwjp.o(.text+0x6e): In function
`__static_initialization_and_destruction_0(int, int)':
: undefined reference to `tsk_tsk()::B::~B()'
collect2: ld returned 1 exit status

This appears to be a flashback of c++/17121.

-- 
           Summary: Another link problem with function-local classes
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Richard dot Kreckel at Framatome-ANP dot com
                CC: gcc-bugs at gcc dot gnu dot org
 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=17155


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