Bug 458904 - Build failure with Clang using libc++
Summary: Build failure with Clang using libc++
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (show other bugs)
Version: 22.08.1
Platform: Gentoo Packages Other
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL: https://bugs.gentoo.org/841416
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-09 02:51 UTC by Sam James
Modified: 2023-06-08 02:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
build.log (184.83 KB, text/plain)
2022-09-09 02:51 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2022-09-09 02:51:57 UTC
Created attachment 151940 [details]
build.log

SUMMARY

kdeconnect fails to compile when using Clang with libc++/libcxx.
```
FAILED: core/CMakeFiles/kdeconnectcore.dir/backends/bluetooth/bluetoothdevicelink.cpp.o 
/usr/lib/llvm/15/bin/clang++ -DHAVE_KIO -DKCOREADDONS_LIB -DKDECONNECT_BLUETOOTH -DQT_BLUETOOTH_LIB -DQT_CORE_LIB -DQT_DBUS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_FROM_ASCII -DQT_NO_DEBUG -DQT_NO_KEYWORDS -DQT_NO_URL_CAST_FROM_STRING -DTRANSLATION_DOMAIN=\"kdeconnect-core\" -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Dkdeconnectcore_EXPORTS -I/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1_build/core -I/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1/core -I/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1_build/core/kdeconnectcore_autogen/include -I/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1 -isystem /usr/include/qt5 -isystem /usr/include/qt5/QtNetwork -isystem /usr/include/qt5/QtCore -isystem /usr/lib64/qt5/mkspecs/linux-clang -isystem /usr/include/KF5/KCoreAddons -isystem /usr/include/KF5 -isystem /usr/include/Qca-qt5/QtCrypto -isystem /usr/include/qt5/QtDBus -isystem /usr/include/KF5/KI18n -isystem /usr/include/KF5/KConfig -isystem /usr/include/KF5/KConfigCore -isystem /usr/include/KF5/KIOCore -isystem /usr/include/KF5/KIO -isystem /usr/include/KF5/KService -isystem /usr/include/KF5/KIOGui -isystem /usr/include/KF5/KWindowSystem -isystem /usr/include/qt5/QtGui -isystem /usr/include/qt5/QtBluetooth  -DQT_NO_DEBUG -O2 -march=native -Werror=format-security -fno-operator-names -fno-exceptions -Wno-gnu-zero-variadic-macro-arguments -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Wvla -Wdate-time -fdiagnostics-color=always -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -std=gnu++17 -MD -MT core/CMakeFiles/kdeconnectcore.dir/backends/bluetooth/bluetoothdevicelink.cpp.o -MF core/CMakeFiles/kdeconnectcore.dir/backends/bluetooth/bluetoothdevicelink.cpp.o.d -o core/CMakeFiles/kdeconnectcore.dir/backends/bluetooth/bluetoothdevicelink.cpp.o -c /var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1/core/backends/bluetooth/bluetoothdevicelink.cpp
/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1/core/backends/bluetooth/bluetoothdevicelink.cpp:95:12: error: chosen constructor is explicit in copy-initialization
    return {}; // TODO Not sure what to do here. For LanDeviceLink we use the SSL connection's certificate, but we don't have that here
           ^~
/usr/include/qt5/QtNetwork/qsslcertificate.h:95:14: note: explicit constructor declared here
    explicit QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem);
             ^
1 error generated.
```



STEPS TO REPRODUCE
1. Install clang and libcxx.
2. Build kdeconnect with CXXFLAGS="-O2 -pipe -stdlib=c++" using CXX=clang++

OBSERVED RESULT

Build failure:
```
/var/tmp/portage/kde-misc/kdeconnect-22.08.1/work/kdeconnect-kde-22.08.1/core/backends/bluetooth/bluetoothdevicelink.cpp:95:12: error: chosen constructor is explicit in copy-initialization
    return {}; // TODO Not sure what to do here. For LanDeviceLink we use the SSL connection's certificate, but we don't hav
```

EXPECTED RESULT

Successful build.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.24.3
KDE Frameworks Version: 5.92.0
Qt Version: 5.15.3 (using Qt5PatchCollection)
Comment 1 Luna D Dragon 2023-06-08 02:40:25 UTC
fixed by https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/540