Bug 434150 - KisBezierTransformMesh.cpp : FTBFS (gcc11 issue?)
Summary: KisBezierTransformMesh.cpp : FTBFS (gcc11 issue?)
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.4.3-beta1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dmitry Kazakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-08 17:32 UTC by Rex Dieter
Modified: 2021-03-10 11:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rex Dieter 2021-03-08 17:32:49 UTC
In file included from /builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:35,
                 from /builddir/build/BUILD/krita-4.4.3-beta1/libs/image/KisBezierTransformMesh.cpp:138:
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h: In instantiation of 'static constexpr bool KritaUtils::is_appendable_container<T>::test(A*) [with A = boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode>; T = boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode>]':
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:114:46:   required from 'const bool KritaUtils::is_appendable_container<boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode> >::value'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:276:1:   required by substitution of 'template<template<class ...> class Container, class T, class E, class ... Args> typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type KisDomUtils::loadValue(const QDomElement&, Container<T, Args ...>*, const E&) [with Container = boost::operators_impl::equality_comparable; T = KisBezierMeshDetails::BaseMeshNode; E = std::tuple<>; Args = {KisBezierMeshDetails::BaseMeshNode, boost::operators_impl::operators_detail::empty_base<KisBezierMeshDetails::BaseMeshNode>, boost::operators_impl::operators_detail::false_t}]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:283:23:   required from 'typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type KisDomUtils::loadValue(const QDomElement&, Container<T, Args ...>*, const E&) [with Container = std::vector; T = KisBezierMeshDetails::BaseMeshNode; E = std::tuple<>; Args = {std::allocator<KisBezierMeshDetails::BaseMeshNode>}; typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type = bool]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:312:21:   required from 'bool KisDomUtils::loadValue(const QDomElement&, const QString&, T*, const E&) [with T = std::vector<KisBezierMeshDetails::BaseMeshNode, std::allocator<KisBezierMeshDetails::BaseMeshNode> >; E = std::tuple<>]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/image/KisBezierTransformMesh.cpp:167:54:   required from here
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:105:48: error: 'struct boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode>' has no member named 'push_back'
  105 |                 std::is_same<decltype(pointer->push_back(std::declval<typename T::value_type>())), void>::value ;
      |                                       ~~~~~~~~~^~~~~~~~~
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:105:63: error: no type named 'value_type' in 'struct boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode>'
  105 |                 std::is_same<decltype(pointer->push_back(std::declval<typename T::value_type>())), void>::value ;
      |                                                          ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h: In instantiation of 'const bool KritaUtils::is_appendable_container<boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode> >::value':
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:276:1:   required by substitution of 'template<template<class ...> class Container, class T, class E, class ... Args> typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type KisDomUtils::loadValue(const QDomElement&, Container<T, Args ...>*, const E&) [with Container = boost::operators_impl::equality_comparable; T = KisBezierMeshDetails::BaseMeshNode; E = std::tuple<>; Args = {KisBezierMeshDetails::BaseMeshNode, boost::operators_impl::operators_detail::empty_base<KisBezierMeshDetails::BaseMeshNode>, boost::operators_impl::operators_detail::false_t}]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:283:23:   required from 'typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type KisDomUtils::loadValue(const QDomElement&, Container<T, Args ...>*, const E&) [with Container = std::vector; T = KisBezierMeshDetails::BaseMeshNode; E = std::tuple<>; Args = {std::allocator<KisBezierMeshDetails::BaseMeshNode>}; typename std::enable_if<KritaUtils::is_appendable_container<Container<T, Args ...> >::value, bool>::type = bool]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/kis_dom_utils.h:312:21:   required from 'bool KisDomUtils::loadValue(const QDomElement&, const QString&, T*, const E&) [with T = std::vector<KisBezierMeshDetails::BaseMeshNode, std::allocator<KisBezierMeshDetails::BaseMeshNode> >; E = std::tuple<>]'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/image/KisBezierTransformMesh.cpp:167:54:   required from here
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:114:46:   in 'constexpr' expansion of 'KritaUtils::is_appendable_container<boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode> >::test<boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode> >(0)'
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:114:23: error: 'constexpr' call flows off the end of the function
  114 |     static const bool value = test<test_type>(nullptr);
      |                       ^~~~~
gmake[2]: *** [libs/image/CMakeFiles/kritaimage.dir/build.make:3790: libs/image/CMakeFiles/kritaimage.dir/KisBezierTransformMesh.cpp.o] Error 1
Comment 1 Halla Rempt 2021-03-08 18:06:39 UTC
This looks a bit like an old gcc bug has returned: https://gcc.gnu.org/legacy-ml/gcc-patches/2018-01/msg01866.html
Comment 2 Rex Dieter 2021-03-08 19:37:38 UTC
may be multiple things?

fedora34 uses a newer boost-1.75, which may be relevant to:
/builddir/build/BUILD/krita-4.4.3-beta1/libs/global/krita_container_utils.h:105:48: error: 'struct boost::operators_impl::equality_comparable<KisBezierMeshDetails::BaseMeshNode>' has no member named 'push_back'
Comment 3 Halla Rempt 2021-03-08 20:35:06 UTC
oh, that might be it, too.

Meh...
Comment 4 Jonathan Wakely 2021-03-09 17:32:24 UTC
KritaUtils::is_appendable_container is completely broken.

You need to test the pointer->push_back expression in a SFINAE context, not in the function body. This is not a GCC bug.
Comment 5 Jonathan Wakely 2021-03-09 17:39:40 UTC
Maybe you meant to use typename A::value_type not typename T::value_type, but it still wouldn't work.

This would be better:

    template<typename A, typename R = decltype(declval<A&>().push_back(std::declval<typename A::value_type>()))>
    static constexpr bool test(A *pointer) {
        return  is_container<A>::value && std::is_same<R, void>::value;
    }

You could also use std::is_void<R>::value instead of is_same.
Comment 6 Halla Rempt 2021-03-09 17:47:01 UTC
Dmitry, can you please take a look?
Comment 7 Dmitry Kazakov 2021-03-09 17:53:45 UTC
Git commit 10f61f0733a728dfa49dd2c3c70deb64be9cc7a4 by Dmitry Kazakov.
Committed on 09/03/2021 at 17:53.
Pushed by dkazakov into branch 'krita/4.3'.

Fix compilation for GCC11

SFINAE tests should happen in the functin signature, not in
its body.

Thanks Jonathan Wakely for the suggested fix!

M  +4    -6    libs/global/krita_container_utils.h

https://invent.kde.org/graphics/krita/commit/10f61f0733a728dfa49dd2c3c70deb64be9cc7a4
Comment 8 Dmitry Kazakov 2021-03-09 17:54:29 UTC
Git commit 9c7cec0a0412a2fee681dd9c83cc3d1ad25ce042 by Dmitry Kazakov.
Committed on 09/03/2021 at 17:54.
Pushed by dkazakov into branch 'master'.

Fix compilation for GCC11

SFINAE tests should happen in the functin signature, not in
its body.

Thanks Jonathan Wakely for the suggested fix!

M  +4    -6    libs/global/krita_container_utils.h

https://invent.kde.org/graphics/krita/commit/9c7cec0a0412a2fee681dd9c83cc3d1ad25ce042
Comment 9 Jonathan Wakely 2021-03-09 20:32:03 UTC
(In reply to Jonathan Wakely from comment #5)
>     static constexpr bool test(A *pointer) {

Oh, now that 'poionter' is unused you might want to remove the name of that parameter, to avoid -Wunused-parameter warnings.
Comment 10 Halla Rempt 2021-03-10 11:51:54 UTC
Git commit cd42aa43521a5258e5cfcdfb21b1cfe18f784be3 by Halla Rempt, on behalf of Dmitry Kazakov.
Committed on 10/03/2021 at 11:51.
Pushed by rempt into branch 'krita/4.4.3'.

Fix compilation for GCC11

SFINAE tests should happen in the functin signature, not in
its body.

Thanks Jonathan Wakely for the suggested fix!
(cherry picked from commit 10f61f0733a728dfa49dd2c3c70deb64be9cc7a4)

M  +4    -6    libs/global/krita_container_utils.h

https://invent.kde.org/graphics/krita/commit/cd42aa43521a5258e5cfcdfb21b1cfe18f784be3