[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#409512: Causes FTBFS with GCC 4.2: problematic comparison in qbutton.h



Package: libqt3-headers
Version: 3.3.7-3

A QT3 header causes another package to fail to build with with GCC 4.2.
Version 4.2 has not been released yet but I'm building with a snapshot
in order to find errors and give people an advance warning.  The
problem is with the qbutton.h header.

The original problem was found compiling the boson package but Ben
Hutchings provided the following small testcase to show the problem:

class my_int
{
public:
    my_int(int) {}
};
bool operator!=(unsigned int, const my_int &) { return false; }
#include <qbutton.h>

Suggested fix:

17:32 <Womble2> I'm going to say the error is in qbutton.h
17:32 <Womble2> It should use "return ToggleType(toggleTyp) != SingleShot;"


Error:

(sid)993:tbm@em64t: ~/src] /usr/lib/gcc-snapshot/bin/g++ -I /usr/include/qt3 -c t.cc
In file included from t.cc:7:
/usr/include/qt3/qbutton.h: In member function 'bool QButton::isToggleButton() const':
/usr/include/qt3/qbutton.h:183: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/qt3/qbutton.h:183: note: candidate 1: operator!=(int, int) <built-in>
t.cc:6: note: candidate 2: bool operator!=(unsigned int, const my_int&)
/usr/include/qt3/qbutton.h:183: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/qt3/qbutton.h:183: note: candidate 1: operator!=(int, int) <built-in>
t.cc:6: note: candidate 2: bool operator!=(unsigned int, const my_int&)
/usr/include/qt3/qbutton.h: In member function 'bool QButton::isOn() const':
/usr/include/qt3/qbutton.h:193: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/qt3/qbutton.h:193: note: candidate 1: operator!=(int, int) <built-in>
t.cc:6: note: candidate 2: bool operator!=(unsigned int, const my_int&)
/usr/include/qt3/qbutton.h:193: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
/usr/include/qt3/qbutton.h:193: note: candidate 1: operator!=(int, int) <built-in>
t.cc:6: note: candidate 2: bool operator!=(unsigned int, const my_int&)
zsh: exit 1     /usr/lib/gcc-snapshot/bin/g++ -I /usr/include/qt3 -c t.cc
(sid)994:tbm@em64t: ~/src]

-- 
Martin Michlmayr
http://www.cyrius.com/



Reply to: