public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17121] New: Link problem with function-local classes
@ 2004-08-20 14:46 Richard dot Kreckel at Framatome-ANP dot com
  2004-08-20 15:16 ` [Bug c++/17121] [3.5 regression] " bangerth at dealii dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Richard dot Kreckel at Framatome-ANP dot com @ 2004-08-20 14:46 UTC (permalink / raw)
  To: gcc-bugs

$ g++ -v
Reading specs from
/data/scratch/devtools/gcc-3.5.0-pre-20040815/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: ../gcc-3.5-20040815/configure
--prefix=/data/scratch/devtools/gcc-3.5.0-pre-20040815 --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 20040815 (experimental)
$ cat test.cc
struct A {
    virtual ~A() {}
};

void tsk_tsk()
{
    struct B : public A {};
}
$ cat main.cc
int main() {}
$ g++ -W -Wall -c test.cc
$ g++ -W -Wall main.cc test.o
test.o(.text+0x19): In function `tsk_tsk()':
: undefined reference to `vtable for tsk_tsk()::B'
test.o(.text+0x1d): In function `tsk_tsk()':
: undefined reference to `tsk_tsk()::B::~B()'
test.o(.text+0x23): In function `tsk_tsk()':
: undefined reference to `vtable for tsk_tsk()::B'
test.o(.text+0x27): In function `tsk_tsk()':
: undefined reference to `tsk_tsk()::B::~B()'
collect2: ld returned 1 exit status

As far as I can tell, this used to work with all releases of GCC.

-- 
           Summary: 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=17121


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-21  1:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-20 14:46 [Bug c++/17121] New: Link problem with function-local classes Richard dot Kreckel at Framatome-ANP dot com
2004-08-20 15:16 ` [Bug c++/17121] [3.5 regression] " bangerth at dealii dot org
2004-08-20 15:17 ` bangerth at dealii dot org
2004-08-20 15:34 ` pinskia at gcc dot gnu dot org
2004-08-20 15:35 ` pinskia at gcc dot gnu dot org
2004-08-21  1:31 ` cvs-commit at gcc dot gnu dot org
2004-08-21  1:32 ` mmitchel at gcc dot gnu dot org

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).