Bug 407015 - wacomtablet FTBFS with gcc9+
Summary: wacomtablet FTBFS with gcc9+
Status: RESOLVED FIXED
Alias: None
Product: wacomtablet
Classification: Plasma
Component: general (show other bugs)
Version: 3.1.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Valerii Malov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-28 15:00 UTC by Rex Dieter
Modified: 2019-05-02 15:13 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rex Dieter 2019-04-28 15:00:51 UTC
Testing on fedora 30 with gcc-9.0.1, wacomtablet builds fail with error:

[ 11%] Building CXX object src/common/CMakeFiles/wacom_common.dir/libwacomwrapper.cpp.o
In file included from /usr/include/c++/9/memory:80,
                 from /var/tmp/kdecache-rdieter/BUILDROOT/wacomtablet-3.1.1/src/common/libwacomwrapper.cpp:24:
/usr/include/c++/9/bits/unique_ptr.h: In instantiation of ‘std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = _WacomError; _Dp = Wacom::libWacomWrapper::lookupTabletInfo(int, int, Wacom::TabletInformation&)::<lambda(WacomError*&)>]’:
/var/tmp/kdecache-rdieter/BUILDROOT/wacomtablet-3.1.1/src/common/libwacomwrapper.cpp:65:53:   required from here
/usr/include/c++/9/bits/unique_ptr.h:285:56: error: static assertion failed: unique_ptr's deleter must be invocable with a pointer
  285 |  static_assert(__is_invocable<deleter_type&, pointer>::value,
      |                                                        ^~~~~
/usr/include/c++/9/bits/unique_ptr.h:289:17: error: no match for call to ‘(std::unique_ptr<_WacomError, Wacom::libWacomWrapper::lookupTabletInfo(int, int, Wacom::TabletInformation&)::<lambda(WacomError*&)> >::deleter_type {aka Wacom::libWacomWrapper::lookupTabletInfo(int, int, Wacom::TabletInformation&)::<lambda(WacomError*&)>}) (std::remove_reference<_WacomError*&>::type)’
  289 |    get_deleter()(std::move(__ptr));
      |    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/unique_ptr.h:289:17: note: candidate: ‘void (*)(WacomError*&)’ {aka ‘void (*)(_WacomError*&)’} <conversion>
/usr/include/c++/9/bits/unique_ptr.h:289:17: note:   conversion of argument 2 would be ill-formed:
/usr/include/c++/9/bits/unique_ptr.h:289:17: error: cannot bind non-const lvalue reference of type ‘WacomError*&’ {aka ‘_WacomError*&’} to an rvalue of type ‘std::remove_reference<_WacomError*&>::type’ {aka ‘_WacomError*’}
/var/tmp/kdecache-rdieter/BUILDROOT/wacomtablet-3.1.1/src/common/libwacomwrapper.cpp:63:25: note: candidate: ‘Wacom::libWacomWrapper::lookupTabletInfo(int, int, Wacom::TabletInformation&)::<lambda(WacomError*&)>’ <near match>
   63 |     auto errorDeleter = [](WacomError *&e){libwacom_error_free(&e);};
      |                         ^
/var/tmp/kdecache-rdieter/BUILDROOT/wacomtablet-3.1.1/src/common/libwacomwrapper.cpp:63:25: note:   conversion of argument 1 would be ill-formed:
In file included from /usr/include/c++/9/memory:80,
                 from /var/tmp/kdecache-rdieter/BUILDROOT/wacomtablet-3.1.1/src/common/libwacomwrapper.cpp:24:
/usr/include/c++/9/bits/unique_ptr.h:289:17: error: cannot bind non-const lvalue reference of type ‘WacomError*&’ {aka ‘_WacomError*&’} to an rvalue of type ‘std::remove_reference<_WacomError*&>::type’ {aka ‘_WacomError*’}
  289 |    get_deleter()(std::move(__ptr));
      |    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/9/bits/unique_ptr.h:153:18: warning: ‘std::__uniq_ptr_impl<_Tp, _Dp>::pointer& std::__uniq_ptr_impl<_Tp, _Dp>::_M_ptr() [with _Tp = _WacomError; _Dp = Wacom::libWacomWrapper::lookupTabletInfo(int, int, Wacom::TabletInformation&)::<lambda(WacomError*&)>]’ used but never defined
  153 |       pointer&   _M_ptr() { return std::get<0>(_M_t); }
      |                  ^~~~~~
make[2]: *** [src/common/CMakeFiles/wacom_common.dir/build.make:194: src/common/CMakeFiles/wacom_common.dir/libwacomwrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:631: src/common/CMakeFiles/wacom_common.dir/all] Error 2
make: *** [Makefile:133: all] Error 2
Comment 1 Valerii Malov 2019-04-28 16:48:15 UTC
Git commit 810487c4fa240f6de598b04929bb08de8937feb5 by Valerii Malov.
Committed on 28/04/2019 at 16:10.
Pushed by valeriymalov into branch 'master'.

(Supposedly) fix building with gcc9

I don't really have access to gcc9 right now to test, but this should
fix "static assertion failed: unique_ptr's deleter must be invocable
with a pointer"

M  +1    -1    src/common/libwacomwrapper.cpp

https://commits.kde.org/wacomtablet/810487c4fa240f6de598b04929bb08de8937feb5
Comment 2 Valerii Malov 2019-04-28 16:50:01 UTC
Hello, I don't think I can get my hands on gcc9 in the nearest time. Can you try the following patch? https://cgit.kde.org/wacomtablet.git/patch/?id=810487c4fa240f6de598b04929bb08de8937feb5

If this fixes the problem, do you need a bugfix release or you'll fine with a patch until next release?
Comment 3 Rex Dieter 2019-04-28 20:21:04 UTC
Patch is fine for me, I can test later today.  Thanks
Comment 4 Rex Dieter 2019-04-28 23:29:36 UTC
Confirmed patch works as advertised, thanks.