[Kde-pim] Item::setPayload() and Studio 12

Adriaan de Groot groot at kde.org
Mon Sep 20 14:09:30 BST 2010


Howdy PIMsters,

I'm trying to get the latest PIM snapshot -- that's 4.5.68svn1174542 -- to 
build with Sun Studio 12.1 (not Solaris Studio 12.2). Sudio doesn't always 
agree with g++ over templates. See, for instance

	http://bugs.kde.org/251638

The problem is in Akonadi's Item::setPayload(). In the referenced bug report, 
the solution was pretty simple: do the cast from KCalCore::Event to 
KCalCore::Incidence by hand, and the problem went away. Thanks to Sergio on 
IRC for doing that.

In PIM-proper, though, similar problems reappear:

[  9%] Building CXX object 
calendarsupport/CMakeFiles/calendarsupport.dir/calendaradaptor.o
"/opt/kde4/include/QtCore/qobject.h", line 453: Warning: Initializing const 
Akonadi::ItemCreateJob& to a NULL value.
"/opt/kde4/include/QtCore/qobject.h", line 453:     Where: While instantiating 
"Akonadi::ItemCreateJob::qt_check_for_QOBJECT_macro<Akonadi::ItemCreateJob>(const 
Akonadi::ItemCreateJob&) const".
"/opt/kde4/include/QtCore/qobject.h", line 453:     Where: Instantiated from 
qobject_cast<const Akonadi::ItemCreateJob*>(QObject*).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 284:     Where: Instantiated from non-template code.
"/opt/kde4/include/QtCore/qobject.h", line 453: Warning: Initializing const 
Akonadi::ItemDeleteJob& to a NULL value.
"/opt/kde4/include/QtCore/qobject.h", line 453:     Where: While instantiating 
"Akonadi::ItemDeleteJob::qt_check_for_QOBJECT_macro<Akonadi::ItemDeleteJob>(const 
Akonadi::ItemDeleteJob&) const".
"/opt/kde4/include/QtCore/qobject.h", line 453:     Where: Instantiated from 
qobject_cast<const Akonadi::ItemDeleteJob*>(QObject*).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 318:     Where: Instantiated from non-template code.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 636: Error: Could 
not find a match for Akonadi::Item::setPayloadImpl<Akonadi::Item::T>(const 
QSharedPointer<KCalCore::Journal>) needed in 
Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&, const int*).
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622:     Where: 
While instantiating 
"Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&, const int*)".
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622:     Where: 
Instantiated from 
Akonadi::Item::setPayload<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 58:     Where: Instantiated from non-template code.
1 Error(s) and 2 Warning(s) detected.


I have akonadi 1.4.52 installed. This is the *only* instance of setPayload in 
KDE PIM that fails with this compiler. If I turn on verbose template expansion 
in the compile, I get the following (annoying feature of Sun Studio: in some 
template expansions, it never tells you the source line number that 
*triggered* the template expansion. You see that here: line 58 is the template 
definition, but no indication which instantiation it actually is.)

"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 424: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 427: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 431: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 434: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 438: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 441: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 493: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 493: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 507: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 507: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 579: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 579: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 598: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 598: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 626: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 626: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 640: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 640: Information: 
Unable to instantiate 
Akonadi::Internal::PayloadTrait<Akonadi::Internal::T>::isPolymorphic.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 58: Information: Instantiating 
Akonadi::Item::setPayload<QSharedPointer<KCalCore::Incidence>>(const 
QSharedPointer<KCalCore::Incidence>&).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 107: Information: Instantiating QList<Akonadi::Item>::~QList().
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 37: Information: Instantiating 
Akonadi::Item::hasPayload<QSharedPointer<KCalCore::Event>>() const.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 40: Information: Instantiating 
Akonadi::Item::payload<QSharedPointer<KCalCore::Event>>() const.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 37: Information: Instantiating 
Akonadi::Item::hasPayload<QSharedPointer<KCalCore::Todo>>() const.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 40: Information: Instantiating 
Akonadi::Item::payload<QSharedPointer<KCalCore::Todo>>() const.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 37: Information: Instantiating 
Akonadi::Item::hasPayload<QSharedPointer<KCalCore::Journal>>() const.
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 40: Information: Instantiating 
Akonadi::Item::payload<QSharedPointer<KCalCore::Journal>>() const.
"/opt/kde4/include/QtCore/qstringlist.h", line 70: Information: Instantiating 
QList<QString>::append(const QString&).
Information: Instantiating QList<QString>::~QList().
"/opt/kde4/include/QtCore/qlist.h", line 114: Information: Instantiating 
QList<Akonadi::Item>::detach_helper().
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 48: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Journal>>::append(const 
QSharedPointer<KCalCore::Journal>&).
"/opt/kde4/include/QtCore/qvector.h", line 118: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Journal>>::detach_helper().
"/opt/kde4/include/QtCore/qvector.h", line 119: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Journal>>::free(QVectorTypedData<QSharedPointer<KCalCore::Journal>>*).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 58: Information: Instantiating 
Akonadi::Item::setPayload<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 48: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Todo>>::append(const 
QSharedPointer<KCalCore::Todo>&).
"/opt/kde4/include/QtCore/qvector.h", line 118: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Todo>>::detach_helper().
"/opt/kde4/include/QtCore/qvector.h", line 119: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Todo>>::free(QVectorTypedData<QSharedPointer<KCalCore::Todo>>*).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 58: Information: Instantiating 
Akonadi::Item::setPayload<QSharedPointer<KCalCore::Todo>>(const 
QSharedPointer<KCalCore::Todo>&).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 48: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Event>>::append(const 
QSharedPointer<KCalCore::Event>&).
"/opt/kde4/include/QtCore/qvector.h", line 118: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Event>>::detach_helper().
"/opt/kde4/include/QtCore/qvector.h", line 119: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Event>>::free(QVectorTypedData<QSharedPointer<KCalCore::Event>>*).
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 621: Information: 
Instantiating mpl_::bool_<0>::value.
Information: Unable to instantiate 
Akonadi::Internal::PayloadTrait<QSharedPointer<KCalCore::Incidence>>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622: Information: 
Instantiating 
Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Incidence>>(const 
QSharedPointer<KCalCore::Incidence>&).
"/opt/kde4/include/QtCore/qlist.h", line 621: Information: Instantiating 
QList<Akonadi::Item>::free(QListData::Data*).
Information: Unable to instantiate 
Akonadi::Internal::PayloadTrait<QSharedPointer<KCalCore::Event>>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 575: Information: 
Instantiating 
Akonadi::Item::hasPayloadImpl<QSharedPointer<KCalCore::Event>>(const int*) 
const.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 489: Information: 
Instantiating 
Akonadi::Item::payloadImpl<QSharedPointer<KCalCore::Event>>(const int*) const.
Information: Unable to instantiate 
Akonadi::Internal::PayloadTrait<QSharedPointer<KCalCore::Todo>>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 575: Information: 
Instantiating 
Akonadi::Item::hasPayloadImpl<QSharedPointer<KCalCore::Todo>>(const int*) 
const.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 489: Information: 
Instantiating Akonadi::Item::payloadImpl<QSharedPointer<KCalCore::Todo>>(const 
int*) const.
Information: Unable to instantiate 
Akonadi::Internal::PayloadTrait<QSharedPointer<KCalCore::Journal>>::isPolymorphic.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 575: Information: 
Instantiating 
Akonadi::Item::hasPayloadImpl<QSharedPointer<KCalCore::Journal>>(const int*) 
const.
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 489: Information: 
Instantiating 
Akonadi::Item::payloadImpl<QSharedPointer<KCalCore::Journal>>(const int*) 
const.
"/opt/kde4/include/QtCore/qlist.h", line 122: Information: Instantiating 
QList<QString>::detach_helper().
"/opt/kde4/include/QtCore/qlist.h", line 621: Information: Instantiating 
QList<QString>::free(QListData::Data*).
"/opt/kde4/include/QtCore/qvector.h", line 548: Information: Instantiating 
QVector<QSharedPointer<KCalCore::Journal>>::realloc(int, int).
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622: Information: 
Instantiating 
Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&, const int*).
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 636: Error: Could 
not find a match for Akonadi::Item::setPayloadImpl<Akonadi::Item::T>(const 
QSharedPointer<KCalCore::Journal>) needed in 
Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&, const int*).
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622:     Where: 
While instantiating 
"Akonadi::Item::setPayloadImpl<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&, const int*)".
"/opt/kde4/include/KDE/Akonadi/../../akonadi/item.h", line 622:     Where: 
Instantiated from 
Akonadi::Item::setPayload<QSharedPointer<KCalCore::Journal>>(const 
QSharedPointer<KCalCore::Journal>&).
"/home/adridg/packages/BUILD/kdepim-4.5.68svn1174542/calendarsupport/calendaradaptor.cpp", 
line 58:     Where: Instantiated from non-template code.
1 Error(s) and 2 Warning(s) detected.


On line 94 of calendaradaptor.cpp, there's an explicit constructor of type 
KCalCore::Incidence::Ptr applied to the Event::Ptr; that one compiles with no 
complaint. Line 148 has a KCalCore::Todo::Ptr, and that fails to compile with 
the errors above. If I add the same explicit constructor for Incidence::Ptr, 
it compiles.

The template-fu going on in Akonadi::Item is too strong for me, which is why 
I'm turning to the list. For the time being, we (the Solaris folks) will be 
munging everything to a KCalCore::Incidence::Ptr and hoping for the best.


[ade]
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list