bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nested class and -O option make Undefs


From: Christophe Delarue
Subject: nested class and -O option make Undefs
Date: 5 Dec 2001 02:17:09 -0800

I've got class definition inside a method implementation like :
class Foo {
  public:
    Foo();
};
class Virtual {
  public:
    virtual void execute() = 0;
};

Foo::Foo()
{
    class Lambda : public Virtual {
      public:
        void execute(){}
    } ;
    Lambda l;
    l.execute();
}


If I compile my code with -O option :
/opt/exp/gnu/bin/g++ -O -g toto.cc -c -o toto.o 

rnbl927:/work/Exe/cpu/target/SimulationMiddleware/obj_sun> g++
--version
2.95.2
rnbl927:/work/Exe/cpu/target/SimulationMiddleware/obj_sun>  g++ -O
~/temp/toto.cc -g -c ; nm toto.o | c++filt
00000000 a *ABS*
00000028 t Letext
00000010 T Foo::Foo(void)
00000000 ? __FRAME_BEGIN__
00000000 t __Q33Foo8__3Foo.0_6Lambda.4
         U __rtti_si
         U __rtti_user
00000000 W Foo::__3Foo.0::Lambda type_info function
00000008 C Virtual type_info node
0000000c C Foo::__3Foo.0::Lambda type_info node
00000000 V Foo::__3Foo.0::Lambda virtual table
         U execute__Q33Foo8__3Foo.0_6Lambda.3

NOTE the undef on Lambda::execute.
I'am on a solaris : uname -a = SunOS rnbl715 5.6 Generic_105181-12
sun4u sparc

 BTW the c++filt do not demangle correctly Lambda::execute.

thank's for any workaround

... Seems to work fine on 3.0.2



reply via email to

[Prev in Thread] Current Thread [Next in Thread]