telegramdesktop / tdesktop

Telegram Desktop messaging app
https://desktop.telegram.org/
Other
26.23k stars 5.2k forks source link

4.10.3 built with clang: Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:817:24: error: n o viable constructor or deduction guide for deduction of template arguments of 'initializer_list' #26878

Closed mid-kid closed 6 months ago

mid-kid commented 1 year ago

I've been trying to build 4.10.2 with clang-16 on gentoo. I've applied the following patch: https://github.com/desktop-app/lib_base/commit/0912ba4b3b67fc485dc43f64664b5a56b9509e02

But now I'm getting the following errors:

/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:499:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "body-markup")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[12], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[12]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[12]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[12]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:515:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "actions")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[8], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[8]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[8]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[8]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:526:7: error: no matching function for call to object of type 'const contains_fn'
                if (ranges::contains(capabilities, "inline-reply")
                    ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[13], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[13]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[13]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[13]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:556:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "action-icons")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[13], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[13]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[13]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[13]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:562:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "sound")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[6], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[6]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[6]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[6]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:572:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "x-canonical-append")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[19], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[19]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[19]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[19]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:808:24: error: no viable constructor or deduction guide for deduction of template arguments of 'initializer_list'
        return ranges::all_of(std::initializer_list{
                              ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:60:17: note: candidate function template not viable: requires 2 arguments, but 4 were provided
      constexpr initializer_list(const_iterator __a, size_type __l)
                ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:45:11: note: candidate function template not viable: requires 1 argument, but 4 were provided
    class initializer_list
          ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:64:17: note: candidate function template not viable: requires 0 arguments, but 4 were provided
      constexpr initializer_list() noexcept
                ^
/var/tmp/portage/net-im/telegram-desktop-4.10.2/work/tdesktop-4.10.2-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:944:6: error: no matching function for call to object of type 'const contains_fn'
        if (ranges::contains(capabilities, "inhibitions")) {
            ^~~~~~~~~~~~~~~~
/usr/include/range/v3/algorithm/contains.hpp:49:24: note: candidate template ignored: constraints not satisfied [with Rng = const std::vector<Glib::ustring> &, T = char[12], P = identity]
        constexpr bool RANGES_FUNC(contains)(Rng && rng, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
/usr/include/range/v3/algorithm/contains.hpp:48:13: note: because 'indirect_relation<equal_to, projected<iterator_t<const vector<ustring, allocator<ustring> > &>, identity>, const char *[12]>' evaluated to false
            indirect_relation<equal_to, projected<iterator_t<Rng>, P>, const T *>)
            ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/iterator/concepts.hpp:673:25: note: because 'ranges::indirect_relation_concept_<ranges::equal_to, __gnu_cxx::__normal_iterator<const Glib::ustring *, std::vector<Glib::ustring> >, const char (*)[12]>' evaluated to false
        CPP_concept_ref(ranges::indirect_relation_, F, I1, I2);
                        ^
/usr/include/range/v3/iterator/concepts.hpp:660:9: note: because 'relation<ranges::equal_to &, iter_value_t<__normal_iterator<const ustring *, vector<ustring, allocator<ustring> > > > &, iter_value_t<const char (*)[12]> &>' evaluated to false
        relation<F &, iter_value_t<I1> &, iter_value_t<I2> &> AND
        ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/functional/concepts.hpp:81:9: note: because 'predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        predicate<R, T, T> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:74:9: note: because 'regular_invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        regular_invocable<Fun, Args...> &&
        ^
/usr/include/range/v3/functional/concepts.hpp:56:9: note: because 'invocable<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        invocable<Fun, Args...>;
        ^
/usr/include/range/v3/functional/concepts.hpp:49:26: note: because 'ranges::invocable_requires_<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false
        CPP_requires_ref(ranges::invocable_, Fun, Args...);
                         ^
/usr/include/range/v3/functional/concepts.hpp:43:13: note: because 'invoke((Fun &&)fn, std::declval<Args>()...)' would be invalid: no matching function for call to object of type 'const invoke_fn'
            invoke((Fun &&) fn, std::declval<Args>()...)
            ^
/usr/include/range/v3/algorithm/contains.hpp:40:24: note: candidate function template not viable: requires at least 3 arguments, but 2 were provided
        constexpr bool RANGES_FUNC(contains)(I first, S last, const T & val, P proj = {})
                       ^
/usr/include/range/v3/detail/config.hpp:633:27: note: expanded from macro 'RANGES_FUNC'
#define RANGES_FUNC(NAME) operator() RANGES_FUNC_CONST_ /**/
                          ^
8 errors generated.
mid-kid commented 1 year ago

The version of range-v3 is 0.12.0

ilya-fedin commented 1 year ago

There's some incompatibility between glibmm and clang. clang warns even when just comparing two Glib::ustring.

mid-kid commented 1 year ago

The word glibmm doesn't appear in the error even once, though? This error seems to be about range-v3.

ilya-fedin commented 1 year ago

The errors say the compiler can't compare the Glib::ustring in the std::vector with the string literal (predicate<ranges::equal_to &, Glib::ustring &, Glib::ustring &>' evaluated to false). In full logs provided by other persons I saw that clang also warns about Glib::ustring's operator== in raw comparisons (e.g. key == key2 in xdp utilities). Apparently clang completely disregards operator== at that point and so checking whether the vector contains a string is not possible.

ilya-fedin commented 1 year ago

Maybe range-v3 can do something about that for ranges::equal_to to evaluate to true in that case, idk. I also don't know whose fault it is for sure and probably we will never get a fix if someone won't report this to clang/range-v3/glibmm (personally I have no interest in doing that).

john-preston commented 1 year ago

@mid-kid I hope it will be worked around in the tomorrow's release. Not a fix, but should build.

ilya-fedin commented 1 year ago

It's happening not the first time and is likely to annoy every single time a new vector of Glib::ustring-s would appear...

ilya-fedin commented 1 year ago

I'd rather vote to not to work around this so interested people finally do something about this and not making tdesktop's code uglier every single time new such code would be added.

mid-kid commented 1 year ago

Wanted to reply but forgot and my comment got deleted. Anyway, I agree with the notion that this should be fixed on the glibmm side. I wonder if similar issues crop up in different projects. That said, I'd really appreciate it if you'd open an issue with the glibmm developers over this. My knowledge of c++ is limited and I'm having a lot of trouble interpreting this error to write a good issue description.

As for gentoo, this isn't a blocker (it's an annoyance for the clang profile peeps but oh well), but I reckon for the BSD side of things this isn't an option. Has this issue been worked around/patched on their side?

john-preston commented 1 year ago

@mid-kid It should build 4.10.3 fine, I hope.

mid-kid commented 1 year ago

I'll try later, but I had applied the relevant patches I thought, so I figured it wouldn't. But thanks!

mid-kid commented 1 year ago

Now I'm getting this:

/var/tmp/portage/net-im/telegram-desktop-4.10.3/work/tdesktop-4.10.3-full/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp:817:24: error: n
o viable constructor or deduction guide for deduction of template arguments of 'initializer_list'
        return ranges::all_of(std::initializer_list{
                              ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:60:17: note: candidate function template not viable: requires 2 arguments, but 4 were pro
vided
      constexpr initializer_list(const_iterator __a, size_type __l)
                ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:45:11: note: candidate function template not viable: requires 1 argument, but 4 were prov
ided
    class initializer_list
          ^
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/initializer_list:64:17: note: candidate function template not viable: requires 0 arguments, but 4 were pro
vided
      constexpr initializer_list() noexcept
                ^
1 error generated.
mid-kid commented 1 year ago

I'm assuming this is a usual "clang+libstdc++" issue, though, and it wouldn't happen on "clang+libc++"

It's also the only error in the entire codebase (running ninja -k0), so I assume everything else is fine.

john-preston commented 1 year ago

@mid-kid can you change initializer_list to array on that line? Will it help?

mid-kid commented 1 year ago

@john-preston that worked!

john-preston commented 1 year ago

@mid-kid Make a PR, please.

github-actions[bot] commented 7 months ago

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!