diff --git a/src/catch2/internal/catch_clara.hpp b/src/catch2/internal/catch_clara.hpp index 8f6a4e9e..a9413810 100644 --- a/src/catch2/internal/catch_clara.hpp +++ b/src/catch2/internal/catch_clara.hpp @@ -636,8 +636,14 @@ namespace Catch { Parser& operator|=(Parser const& other); template - auto operator|(T const& other) const -> Parser { - return Parser(*this) |= other; + friend Parser operator|(Parser const& p, T const& rhs) { + return Parser( p ) |= rhs; + } + + template + friend Parser operator|( Parser&& p, T const& rhs ) { + p |= rhs; + return CATCH_MOVE(p); } std::vector getHelpColumns() const;