On terça-feira, 24 de julho de 2012 16.25.22, Olivier Goffart wrote:
> On Tuesday 24 July 2012 13:06:30 Thiago Macieira wrote:
> > On terça-feira, 24 de julho de 2012 12.13.27, Thiago Macieira wrote:
> > > QFocusHelper
> >
> > This is a class defined in a .cpp, deriving from QWidget. So it has
> > virtual
> > methods by way of inheritance.
> >
> > But since it's in a .cpp, we have to conclude it's a compiler bug.
>
> That class is not instantied: The compiler had no reason to generate a
> destructor or destructor or any type information for a class that never
> exists.

As we established, it's a compiler bug.

> However, doing a static_cast like this class does is an undefined behaviour.
> Qt is broken here.

True, but a static_cast that has worked well for a long time.

> > > QNetworkConfiguration
> >
> > QNetworkConfiguration has no virtual methods, so there should be no TI
> > emitted for it. In fact, this is the odd-man out class in this list, so
> > much so that I doubt that it's QNetworkConfiguration.
> >
> > The OP posted a list output from readelf, which cuts symbols. I'm going to
> > guess here that it was either QNetworkConfigurationManager or
> > QNetworkConfigurationManagerPrivate. Both classes have virtuals, both are
> > exported from QtNetwork and both have their non-inline destructors in a
> > .cpp file.
>
> I think it is QNetworkConfigurationPrivate, since its length is 28 and is
> not instentiated in QtNetwork, but only in bearers plugins.

Ah, indeed.

Here we have a big problem. QNetworkConfigurationPrivate is not exported, so it
can't be used from the plugins. It should be exported and its virtual
destructor should be de-inlined.

> > Any of these three classes indicate a compiler bug.
>
> The question is who needs the typeinfo for those classes? Probably the
> virtual table. But the virtual table has no reason to be emitted for those
> classes because all the virtual method are inline, and the classes are not
> constructed or destructed.

Three things require the TI objects:
 1) the virtual tables
 2) dynamic_cast (includes exception throwing and catching)
 3) typeid()

But, since we're talking about a compiler bug, we are by definition discussing
a non-conformant behaviour. It can be anything.

--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to