[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
Sun Mar 16 13:28:00 GMT 2014


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

--- Comment #45 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to David Kredba from comment #44)
> Hello Markus,
> I moved it (deleted a three lines) from .h file and placed them to asource
> file
> a) beginning of source file after a namespace definition and it failed 
> with:
> 
> /usr/include/qt4/QtCore/qmap.h:107:17: error: no match for 'operator<'
> (operand types are 'const Calligra::Sheets::Conditions' and 'const
> Calligra::Sheets::Conditions')
> /usr/include/qt4/QtCore/qmap.h:107:17: error: no match for 'operator<'
> (operand types are 'const Calligra::Sheets::Conditions' and 'const
> Calligra::Sheets::Conditions')
> 
> b) before the first occurence of qHash and it failed with:
> 
> /usr/include/qt4/QtCore/qmap.h:107:17: error: no match for 'operator<'
> (operand types are 'const Calligra::Sheets::Conditions' and 'const
> Calligra::Sheets::Conditions')
> /usr/include/qt4/QtCore/qmap.h:107:17: error: no match for 'operator<'
> (operand types are 'const Calligra::Sheets::Conditions' and 'const
> Calligra::Sheets::Conditions')
> /usr/include/qt4/QtCore/qmap.h:107:17: error: no match for 'operator<'
> (operand types are 'const Calligra::Sheets::Conditions' and 'const
> Calligra::Sheets::Conditions')
> 
> Could you please write me to what line to place it?
> 
> Thank you in advance.

You need to keep the declaration in Condition.h:
   bool operator<(const Conditions& conditions) const; 
and append the following to Condition.cpp:
bool Conditions::operator<(const Conditions& conditions) const
{
   return qHash(*this) < qHash(conditions);
}

But this is getting way off-topic.



More information about the Gcc-bugs mailing list