Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt6 and range-v3 error build telegram desktop with clang 13-14 #1691

Open
h0tc0d3 opened this issue Mar 14, 2022 · 3 comments
Open

Qt6 and range-v3 error build telegram desktop with clang 13-14 #1691

h0tc0d3 opened this issue Mar 14, 2022 · 3 comments

Comments

@h0tc0d3
Copy link

h0tc0d3 commented Mar 14, 2022

In file included from <built-in>:484:
In file included from /build/telegram-desktop+clang/src/build/Telegram/CMakeFiles/Telegram.dir/cmake_pch.hxx:5:
In file included from /build/telegram-desktop+clang/src/tdesktop-3.6.0-full/Telegram/SourceFiles/stdafx.h:102:
In file included from /usr/include/range/v3/all.hpp:17:
In file included from /usr/include/range/v3/action.hpp:32:
In file included from /usr/include/range/v3/action/split.hpp:28:
/usr/include/range/v3/range/conversion.hpp:379:29: error: alias template 'QVector' requires template arguments; argument deduction only allowed for class templates
                -> decltype(ContT(range_cpp17_iterator_t<Rng>{},
                            ^
/usr/include/meta/meta.hpp:541:5: note: in instantiation of template class 'ranges::detail::from_range<QVector>' requested here
    using invoke = typename Fn::template invoke<Args...>;
    ^
/usr/include/range/v3/range/conversion.hpp:46:13: note: in instantiation of template type alias 'invoke' requested here
            using container_t = meta::invoke<MetaFn, Rng>;
            ^
/usr/include/range/v3/range/conversion.hpp:338:46: note: in instantiation of template type alias 'container_t' requested here
                    convertible_to_cont<Rng, container_t<MetaFn, Rng>>)
                                             ^
/usr/include/range/v3/detail/prologue.hpp:35:26: note: expanded from macro 'template'
    template<__VA_ARGS__ CPP_TEMPLATE_AUX_                                      \
                         ^
/usr/include/range/v3/range/conversion.hpp:304:13: note: in instantiation of template class 'ranges::detail::to_container::fn<ranges::detail::from_range<QVector>>' requested here
          , Fn
            ^
/usr/include/range/v3/range/conversion.hpp:425:20: note: in instantiation of template class 'ranges::detail::to_container::closure<ranges::detail::from_range<QVector>, ranges::detail::to_container::fn<ranges::detail::from_range<QVector>>>' requested here
            return detail::to_container_fn<detail::from_range<ContT>>{}(
                   ^
/build/telegram-desktop+clang/src/tdesktop-3.6.0-full/Telegram/SourceFiles/api/api_media.cpp:86:12: note: in instantiation of function template specialization 'ranges::_to_::to<QVector, std::vector<tl::boxed<MTPinputDocument>> &>' requested here
                        ranges::to<QVector>(info.attachedStickers)),
                                ^
/usr/include/qt6/QtCore/qcontainerfwd.h:63:22: note: template is declared here
template<typename T> using QVector = QList<T>;
                     ^
In file included from <built-in>:484:
In file included from /build/telegram-desktop+clang/src/build/Telegram/CMakeFiles/Telegram.dir/cmake_pch.hxx:5:
In file included from /build/telegram-desktop+clang/src/tdesktop-3.6.0-full/Telegram/SourceFiles/stdafx.h:102:
In file included from /usr/include/range/v3/all.hpp:17:
In file included from /usr/include/range/v3/action.hpp:32:
In file included from /usr/include/range/v3/action/split.hpp:28:
/usr/include/range/v3/range/conversion.hpp:425:20: error: type 'detail::to_container_fn<detail::from_range<QVector>>' (aka 'closure<ranges::detail::from_range<QVector>, ranges::detail::to_container::fn<ranges::detail::from_range<QVector>>>') does not provide a call operator
            return detail::to_container_fn<detail::from_range<ContT>>{}(
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/telegram-desktop+clang/src/tdesktop-3.6.0-full/Telegram/SourceFiles/api/api_media.cpp:86:12: note: in instantiation of function template specialization 'ranges::_to_::to<QVector, std::vector<tl::boxed<MTPinputDocument>> &>' requested here
                        ranges::to<QVector>(info.attachedStickers)),
                                ^
2 errors generated.
@h0tc0d3 h0tc0d3 changed the title Qt6 and range-v3 error build telegram desktop with clang Qt6 and range-v3 error build telegram desktop with clang 13 Mar 14, 2022
@JohelEGP
Copy link
Contributor

That's a language limitation due to a feature Clang has yet to implement. This can't be fixed on Range-v3's side, so you'd have to report to whomever is calling ranges::to<QVector>.

@h0tc0d3 h0tc0d3 changed the title Qt6 and range-v3 error build telegram desktop with clang 13 Qt6 and range-v3 error build telegram desktop with clang 13-14 Mar 23, 2022
@h0tc0d3
Copy link
Author

h0tc0d3 commented Mar 23, 2022

@JohelEGP affects llvm 14 too. So it's not a compiler problem, your library probably violates some of the standards. Because clang gives the best search for errors in the code.

@JohelEGP
Copy link
Contributor

JohelEGP commented Mar 23, 2022

Clang hasn't implemented the feature yet, so it doesn't matter whether it's Clang 14 or 15, except that there's a possibility it's implemented for Clang 15 before its feature freeze.

The feature is "Class template argument deduction for alias templates" at https://en.cppreference.com/w/cpp/compiler_support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants