GCC raises issues with `-Werror=non-template-friend`
Open
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 2.4k
- Forks
- 270
- Avg merge
- 3d 6h
- Merged PRs (30d)
- 39
Description
By default, repositories compiled using the meson build enable -Werror=non-template-friend and this causes the following errors:
../subprojects/wg21_p2300_std_execution/include/execution.hpp:969:66: error: friend declaration ‘void std::execution::__connect::tag_invoke(_Tag, std::execution::__connect::__completion<_Tag(_Args ...)>&&, _Args&& ...)’ declares a non-template function [-Werror=non-template-friend]
969 | friend void tag_invoke(_Tag, __completion&&, _Args&&...) noexcept;
| ^~~~~~~~
../subprojects/wg21_p2300_std_execution/include/execution.hpp:969:66: note: (if this is not what you intended, make sure the function template has already been declared and add ‘<>’ after the function name here)
../subprojects/wg21_p2300_std_execution/include/execution.hpp:978:76: error: friend declaration ‘std::execution::__connect::__debug_env_t<_Env> std::execution::__connect::tag_invoke(std::execution::__env::get_env_t, std::execution::__connect::__debug_receiver<_Env, std::execution::completion_signatures<_Sigs ...> >)’ declares a non-template function [-Werror=non-template-friend]
978 | friend __debug_env_t<_Env> tag_invoke(get_env_t, __debug_receiver) noexcept;
| ^~~~~~~~
../subprojects/wg21_p2300_std_execution/include/execution.hpp:985:71: error: friend declaration ‘void std::execution::__connect::tag_invoke(std::execution::__receivers::set_stopped_t, std::execution::__connect::__any_debug_receiver<_Env>&&)’ declares a non-template function [-Werror=non-template-friend]
985 | friend void tag_invoke(set_stopped_t, __any_debug_receiver&&) noexcept;
| ^~~~~~~~
../subprojects/wg21_p2300_std_execution/include/execution.hpp:986:80: error: friend declaration ‘std::execution::__connect::__debug_env_t<_Env> std::execution::__connect::tag_invoke(std::execution::__env::get_env_t, std::execution::__connect::__any_debug_receiver<_Env>)’ declares a non-template function [-Werror=non-template-friend]
986 | friend __debug_env_t<_Env> tag_invoke(get_env_t, __any_debug_receiver) noexcept;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with subprojects/wg21_p2300_std_execution/include/execution.hpp at lines 969-986 and reproduce the Meson build with GCC and -Werror=non-template-friend. Inspect the reported friend declarations and verify the project still builds successfully with this warning treated as an error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100