extern "C" void abort ();

struct A
{
  A (bool x = true);
};
class B
{
  virtual bool bar (A &, int) const =0;
};
class C : virtual public B
{
};
struct D : virtual public B
{
  bool bar (A &, int) const;
};
template <int N>
struct E : public D
{
  bool bar (A &x, int y) const
  {
    return baz().bar (x, y);
  }
  const D & baz () const;
};
extern template class E<0>;

void
foo ()
{
  try
  {
    A a;
    abort ();
  } catch (...)
  {
  }
  A b;
  E<0> c;
  c.bar (b, 3);
  E<0> d;
  d.bar (b, 3);
}

fails to compile at -O2 and above on x86_64-linux (both -m32 and -m64), with
error: ‘bool A::*.LTHUNK0(A&, int) const’ aliased to undefined symbol
‘_ZNK1EILi0EE3barER1Ai’


-- 
           Summary: [4.4 Regression] aliased to undefined symbol error with
                    thunks
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


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

Reply via email to