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

build: check for P2582R1 support #2446

Closed
wants to merge 1 commit into from

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Sep 19, 2024

in a recent GCC packaging update in fedora, the maintainer backported a patch PR116276 from GCC-14. the patch implements
P2582R1 - Wording for class template argument deduction from inherited constructors which was accepted by C++23. since it's included by C++23, Clang is also working in this direction, see
llvm/llvm-project#92606.

this is the reason why gcc-14.2.1-3 fails to build the tree, which relies on the behavior without P2582R1.

in this change, we check for the support of P2581R1 with CMake, and define SEASTAR_P2581R1 macro if the proposed behavior is implemented. we define the argument deduction guide for rpc::tuple only if this macro is not defined. this should address the build failure. and it is future-proof as once Clang supports P2581R1, we can detect it, and disable the dedution guide as well.

Fixes #2445
Signed-off-by: Kefu Chai [email protected]

@tchaikov tchaikov force-pushed the CTAD-inherited-ctor branch 4 times, most recently from bfc21f2 to f32644d Compare September 19, 2024 13:57
in a recent GCC packaging update in fedora, the maintainer backported a
patch [PR116276](https://gcc.gnu.org/pipermail/gcc-patches/2024-August/659909.html)
from GCC-14. the patch implements
[P2582R1 - Wording for class template argument deduction from inherited constructors](https://wg21.link/P2582R1)
which was accepted by C++23. since it's included by C++23, Clang
is also working in this direction, see
llvm/llvm-project#92606.

this is the reason why gcc-14.2.1-3 fails to build the tree, which
relies on the behavior without P2582R1.

in this change, we check for the support of P2581R1 with
CMake, and defined `SEASTAR_P2581R1` macro if the proposed
behavior is implemented. we define the argument deduction guide
for `rpc::tuple` only if this macro is not defined. this should
address the build failure. and it is future-proof as once Clang
supports P2581R1, we can detect it, and disable the dedution
guide as well.

Fixes scylladb#2445
Signed-off-by: Kefu Chai <[email protected]>
@tchaikov
Copy link
Contributor Author

@scylladb/seastar-maint hello maintainers, could you help review this change?

@xemul xemul closed this in 0b752bb Sep 19, 2024
@tchaikov tchaikov deleted the CTAD-inherited-ctor branch September 19, 2024 16:15
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

Successfully merging this pull request may close these issues.

GCC-14 is not able to compile rpc_test.cc
1 participant