From e73bb666c56d3aac77b8ba59d0273cc74fc9c9ae Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 8 Dec 2025 13:20:56 -0500 Subject: [PATCH] Fix `MAKE_WRAPPER_CONSTRUCTOR` to not override special constructors It should not effect move / copy / etc. constructors. --- src/libutil/include/nix/util/variant-wrapper.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libutil/include/nix/util/variant-wrapper.hh b/src/libutil/include/nix/util/variant-wrapper.hh index 146ae07b6..14c9a3738 100644 --- a/src/libutil/include/nix/util/variant-wrapper.hh +++ b/src/libutil/include/nix/util/variant-wrapper.hh @@ -22,10 +22,12 @@ * * The moral equivalent of `using Raw::Raw;` */ -#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \ - FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \ - \ - CLASS_NAME(auto &&... arg) \ - : raw(std::forward(arg)...) \ - { \ +#define MAKE_WRAPPER_CONSTRUCTOR(CLASS_NAME) \ + FORCE_DEFAULT_CONSTRUCTORS(CLASS_NAME) \ + \ + template \ + requires(!(sizeof...(Args) == 1 && (std::is_same_v, CLASS_NAME> && ...))) \ + CLASS_NAME(Args &&... arg) \ + : raw(std::forward(arg)...) \ + { \ }