D17606: [WIP] Use <optional> if available.

Tobias C. Berner noreply at phabricator.kde.org
Sat Dec 15 16:47:29 GMT 2018


tcberner created this revision.
tcberner added reviewers: FreeBSD, mlaurent, dvratil.
Herald added a project: KDE PIM.
Herald added a subscriber: kde-pim.
tcberner requested review of this revision.

REVISION SUMMARY
  FreeBSD-current recently [1] updated clang&co which means `experimental/optional` is no longer available,
  and errors out as `optional` should be used.
  
  - check if <optional> is present using __has_include
  - simply define stdx = std
  
  This also requires a change to Akonadi to remove the `auto_ptr` variant
  of `setPayload`:
  
    /usr/local/include/KF5/AkonadiCore/item.h:589:48: error: no template named 'auto_ptr' in namespace 'std'
        template <typename T> void setPayload(std::auto_ptr<T> p);
                                              ~~~~~^
    /usr/local/include/KF5/AkonadiCore/item.h:1053:12: error: variable has incomplete type 'void'
    void Item::setPayload(std::auto_ptr<T> p)
               ^
    /usr/local/include/KF5/AkonadiCore/item.h:1053:28: error: no member named 'auto_ptr' in namespace 'std'
    void Item::setPayload(std::auto_ptr<T> p)
                          ~~~~~^
    /usr/local/include/KF5/AkonadiCore/item.h:1053:37: error: 'T' does not refer to a value
    void Item::setPayload(std::auto_ptr<T> p)
                                        ^
    /usr/local/include/KF5/AkonadiCore/item.h:1052:20: note: declared here
    template <typename T>
                       ^
    /usr/local/include/KF5/AkonadiCore/item.h:1053:40: error: use of undeclared identifier 'p'
    void Item::setPayload(std::auto_ptr<T> p)
                                           ^
    /usr/local/include/KF5/AkonadiCore/item.h:1053:42: error: expected ';' at end of declaration
    void Item::setPayload(std::auto_ptr<T> p)
                                             ^
    /usr/local/include/KF5/AkonadiCore/item.h:1054:1: error: expected unqualified-id
    {
    ^
    7 errors generated.
  
  [1] https://svnweb.freebsd.org/base?view=revision&revision=341825

REPOSITORY
  R206 KMail

BRANCH
  Applications/18.12

REVISION DETAIL
  https://phabricator.kde.org/D17606

AFFECTED FILES
  agents/unifiedmailboxagent/CMakeLists.txt
  agents/unifiedmailboxagent/utils.h

To: tcberner, #freebsd, mlaurent, dvratil
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20181215/3227e3fc/attachment.html>


More information about the kde-pim mailing list