Compilation error with master, 5.1 and 5.2 branches

Alexander Shaduri ashaduri at gmail.com
Sun Oct 15 17:05:44 UTC 2017


Hi Kevin,

I tried current 5.2 and it compiles fine.

Thanks for fixing this so quickly!
Alexander


On Sun, 2017-10-15 at 10:29 +0200, Kevin Funk wrote:
> On Saturday, 14 October 2017 23:16:16 CEST Alexander Shaduri wrote:
> > 
> > Hi,
> > 
> > I'm trying to compile at least one of the master, 5.1 or 5.2 branches and
> > I'm getting the following error.
> 
> Thanks for the report. You're probably hitting a compiler bug.
> 
> Fixed in 5.2 and master. See commit below. If you find more issues like that, 
> please patch other locations similarly and then please post the patch here.
> 
> ```
> commit 6d5bdbba0a04d7180bda1f6bb47acb386575a561
> Author: Kevin Funk <kfunk at kde.org>
> Date:   Sun Oct 15 10:26:36 2017 +0200
> 
>     Work-around possible compiler bug in GCC 4.8.x
>     
>     New-style QObject::connect fails with QPointer<T>:
>       https://bugreports.qt.io/browse/QTBUG-48988
> 
> diff --git a/kdevplatform/language/duchain/navigation/
> abstractnavigationwidget.cpp b/kdevplatform/language/duchain/navigation/
> abstractnavigationwidget.cpp
> index 35d82313e0..50f82c1ff2 100644
> --- a/kdevplatform/language/duchain/navigation/abstractnavigationwidget.cpp
> +++ b/kdevplatform/language/duchain/navigation/abstractnavigationwidget.cpp
> @@ -111,7 +111,7 @@ void AbstractNavigationWidget::initBrowser(int height)
>    layout->setMargin(0);
>    setLayout(layout);
>  
> -  connect(d->m_browser, &QTextEdit::selectionChanged, this, [this]() {
> +  connect(d->m_browser.data(), &QTextEdit::selectionChanged, this, [this]() {
>      d->m_browser->copy();
>    });
>    connect(d->m_browser.data(), &QTextBrowser::anchorClicked, this, [&](const 
> QUrl& url) { d->anchorClicked(url); });
> ```
> 
> 
> Thanks,
> Kevin
> 
> > 
> > I think all of the optional dependencies were found.
> > 
> > OpenSUSE 42.2, Qt 5.9.2, KDE framework 5.38, plasma 5.10.5, gcc 4.8.5.
> > 
> > Thanks,
> > Alexander
> > 
> > 
> > Build log:
> > 
> > 
> > [ 14%] Building CXX object
> > kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/duchain/navigatio
> > n/abstractnavigationwidget.cpp.o
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp: In member function ‘void
> > KDevelop::AbstractNavigationWidget::initBrowser(int)’:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: error: no matching function
> > for call to
> > ‘KDevelop::AbstractNavigationWidget::connect(QPointer<QTextBrowser>&, void
> > (QTextEdit::*)(), KDevelop::AbstractNavigationWidget* const,
> > KDevelop::AbstractNavigationWidget::initBrowser(int)::__lambda1)’ });
> >     ^
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/na
> > vigation/abstractnavigationwidget.cpp:116:4: note: candidates are: In file
> > included from /usr/include/qt5/QtCore/qsharedpointer_impl.h:64:0, from
> > /usr/include/qt5/QtCore/qsharedpointer.h:48, from
> > /usr/include/qt5/QtCore/qpointer.h:43,
> >                  from /usr/include/qt5/QtCore/QPointer:1,
> >                  from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.h:23, from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:20:
> > /usr/include/qt5/QtCore/qobject.h:213:36: note: static
> > QMetaObject::Connection QObject::connect(const QObject*, const char*, const
> > QObject*, const char*, Qt::ConnectionType) static QMetaObject::Connection
> > connect(const QObject *sender, const char *signal, ^
> > /usr/include/qt5/QtCore/qobject.h:213:36: note:   no known conversion for
> > argument 2 from ‘void (QTextEdit::*)()’ to ‘const char*’
> > /usr/include/qt5/QtCore/qobject.h:216:36: note: static
> > QMetaObject::Connection QObject::connect(const QObject*, const
> > QMetaMethod&, const QObject*, const QMetaMethod&, Qt::ConnectionType)
> > static QMetaObject::Connection connect(const QObject *sender, const
> > QMetaMethod &signal, ^
> > /usr/include/qt5/QtCore/qobject.h:216:36: note:   no known conversion for
> > argument 2 from ‘void (QTextEdit::*)()’ to ‘const QMetaMethod&’
> > /usr/include/qt5/QtCore/qobject.h:468:32: note: QMetaObject::Connection
> > QObject::connect(const QObject*, const char*, const char*,
> > Qt::ConnectionType) const inline QMetaObject::Connection
> > QObject::connect(const QObject *asender, const char *asignal, ^
> > /usr/include/qt5/QtCore/qobject.h:468:32: note:   no known conversion for
> > argument 2 from ‘void (QTextEdit::*)()’ to ‘const char*’
> > /usr/include/qt5/QtCore/qobject.h:233:43: note: template<class Func1, class
> > Func2> static QMetaObject::Connection QObject::connect(const typename
> > QtPrivate::FunctionPointer<Func>::Object*, Func1, const typename
> > QtPrivate::FunctionPointer<Func2>::Object*, Func2, Qt::ConnectionType)
> > static inline QMetaObject::Connection connect(const typename
> > QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, ^
> > /usr/include/qt5/QtCore/qobject.h:233:43: note:   template argument
> > deduction/substitution failed:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: note:   mismatched types
> > ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and
> > ‘QPointer<QTextBrowser>’ });
> >     ^
> > In file included from /usr/include/qt5/QtCore/qsharedpointer_impl.h:64:0,
> >                  from /usr/include/qt5/QtCore/qsharedpointer.h:48,
> >                  from /usr/include/qt5/QtCore/qpointer.h:43,
> >                  from /usr/include/qt5/QtCore/QPointer:1,
> >                  from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.h:23, from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:20:
> > /usr/include/qt5/QtCore/qobject.h:265:13: note: template<class Func1, class
> > Func2> static typename
> > std::enable_if<((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >=
> > 0), QMetaObject::Connection>::type QObject::connect(const typename
> > QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) connect(const
> > typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
> > Func2 slot) ^
> > /usr/include/qt5/QtCore/qobject.h:265:13: note:   template argument
> > deduction/substitution failed:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: note:   mismatched types
> > ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and
> > ‘QPointer<QTextBrowser>’ });
> >     ^
> > In file included from /usr/include/qt5/QtCore/qsharedpointer_impl.h:64:0,
> >                  from /usr/include/qt5/QtCore/qsharedpointer.h:48,
> >                  from /usr/include/qt5/QtCore/qpointer.h:43,
> >                  from /usr/include/qt5/QtCore/QPointer:1,
> >                  from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.h:23, from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:20:
> > /usr/include/qt5/QtCore/qobject.h:274:13: note: template<class Func1, class
> > Func2> static typename
> > std::enable_if<(((int)(QtPrivate::FunctionPointer<Func2>::ArgumentCount) >=
> > 0) && (! QtPrivate::FunctionPointer<Func2>::IsPointerToMemberFunction)),
> > QMetaObject::Connection>::type QObject::connect(const typename
> > QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2,
> > Qt::ConnectionType) connect(const typename
> > QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const
> > QObject *context, Func2 slot, ^
> > /usr/include/qt5/QtCore/qobject.h:274:13: note:   template argument
> > deduction/substitution failed:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: note:   mismatched types
> > ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and
> > ‘QPointer<QTextBrowser>’ });
> >     ^
> > In file included from /usr/include/qt5/QtCore/qsharedpointer_impl.h:64:0,
> >                  from /usr/include/qt5/QtCore/qsharedpointer.h:48,
> >                  from /usr/include/qt5/QtCore/qpointer.h:43,
> >                  from /usr/include/qt5/QtCore/QPointer:1,
> >                  from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.h:23, from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:20:
> > /usr/include/qt5/QtCore/qobject.h:305:13: note: template<class Func1, class
> > Func2> static typename
> > std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)),
> > QMetaObject::Connection>::type QObject::connect(const typename
> > QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) connect(const
> > typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal,
> > Func2 slot) ^
> > /usr/include/qt5/QtCore/qobject.h:305:13: note:   template argument
> > deduction/substitution failed:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: note:   mismatched types
> > ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and
> > ‘QPointer<QTextBrowser>’ });
> >     ^
> > In file included from /usr/include/qt5/QtCore/qsharedpointer_impl.h:64:0,
> >                  from /usr/include/qt5/QtCore/qsharedpointer.h:48,
> >                  from /usr/include/qt5/QtCore/qpointer.h:43,
> >                  from /usr/include/qt5/QtCore/QPointer:1,
> >                  from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.h:23, from
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:20:
> > /usr/include/qt5/QtCore/qobject.h:313:13: note: template<class Func1, class
> > Func2> static typename
> > std::enable_if<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)),
> > QMetaObject::Connection>::type QObject::connect(const typename
> > QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2,
> > Qt::ConnectionType) connect(const typename
> > QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const
> > QObject *context, Func2 slot, ^
> > /usr/include/qt5/QtCore/qobject.h:313:13: note:   template argument
> > deduction/substitution failed:
> > /0S/0devel/DL-CVS/kdevelop/kdev5.2/kdevelop/kdevplatform/language/duchain/n
> > avigation/abstractnavigationwidget.cpp:116:4: note:   mismatched types
> > ‘const typename QtPrivate::FunctionPointer<Func>::Object*’ and
> > ‘QPointer<QTextBrowser>’ });
> >     ^
> > kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/build.make:1918:
> > recipe for target
> > 'kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/duchain/navigati
> > on/abstractnavigationwidget.cpp.o' failed make[2]: ***
> > [kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/duchain/navigati
> > on/abstractnavigationwidget.cpp.o] Error 1 CMakeFiles/Makefile2:811: recipe
> > for target 'kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/all'
> > failed make[1]: ***
> > [kdevplatform/language/CMakeFiles/KDevPlatformLanguage.dir/all] Error 2
> > Makefile:127: recipe for target 'all' failed
> > make: *** [all] Error 2
> 
> 


More information about the KDevelop-devel mailing list