[Bug c++/58678] [4.9 Regression] pykde4-4.11.2 link error (devirtualization too trigger happy)

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 5 15:02:00 GMT 2014


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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #23 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
> Is this a new re-occurence?

Looks likely:

markus@x4 tmp % < test.ii
template <typename T> class A
{
public:
  A (T &);
  typename T::const_iterator i;
};

template <typename T> class B
{
public:
  class const_iterator
  {
  public:
    T &operator*();
  };
};

namespace KParts
{
class PartBase
{
public:
  virtual ~PartBase ();
};
class Part : PartBase
{
};
}
class Part : KParts::Part
{
public:
  typedef B<Part *> List;
  ~Part () {}
};
void fn1 (Part::List &p1)
{
  for (A<__typeof__ p1> a (p1);;)
    for (Part *b = *a.i;;)
      delete b;
}
markus@x4 tmp % g++ -Wall -Wextra -c -O2 test.ii
markus@x4 tmp % nm test.o | c++filt
0000000000000000 T fn1(B<Part*>&)
                 U operator delete(void*)
                 U A<B<Part*> >::A(B<Part*>&)
                 U B<Part*>::const_iterator::operator*()
0000000000000000 W Part::~Part()
0000000000000000 W Part::~Part()
0000000000000000 W Part::~Part()
0000000000000000 n Part::~Part()
0000000000000000 W KParts::Part::~Part()
0000000000000000 W KParts::Part::~Part()
0000000000000000 W KParts::Part::~Part()
0000000000000000 n KParts::Part::~Part()
                 U KParts::PartBase::~PartBase()
0000000000000000 V typeinfo for KParts::Part
                 U typeinfo for KParts::PartBase
0000000000000000 V typeinfo name for KParts::Part
                 U vtable for __cxxabiv1::__vmi_class_type_info
0000000000000000 V vtable for KParts::Part

markus@x4 tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3/g++ -Wall -Wextra -c -O2
test.ii
markus@x4 tmp % nm test.o | c++filt
0000000000000000 T fn1(B<Part*>&)
                 U A<B<Part*> >::A(B<Part*>&)
                 U B<Part*>::const_iterator::operator*()
markus@x4 tmp %



More information about the Gcc-bugs mailing list