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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-04-09 
19:40:41 UTC ---
(In reply to comment #6)
> and i test a c++ file,it will remove the unused funcitons "notused":

But that is not the same as there is no vtable for hello.
Try:
#include <iostream>

class hello
{
public:
        hello()
        {
        }
        virtual void notused()
        {
                std::cout << "not used";
        }
        virtual void used()
        {
                std::cout << "used";
        }
        virtual ~hello()
        {
        }
}hi;

int main()
{       hello t;
        t.used();
        return 0;
}

And see the result.

Reply via email to