Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2024-01-02 23:27:13 +0100
committerMartin Hořeňovský2024-01-02 23:27:13 +0100
commit863c662c0eff026300f4d729a7054e90d6d12cdd (patch)
tree8b2d0b038d623ff32be5e4d54b1e79fd829a598b /src
parentf981c9cbcac07a2690e5a86767eba490b5465463 (diff)
downloadcatch3-863c662c0eff026300f4d729a7054e90d6d12cdd.tar.gz
Fix adding Opts with | to lvalue Parser
This is the recommended way of adding new Opts in our documentation for using custom main, but we did not compile the code to see if it works. We now compile the example as part of the BUILD_EXAMPLES option. Fixes #2787
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_clara.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/catch2/internal/catch_clara.hpp b/src/catch2/internal/catch_clara.hpp
index b7001db2..d869593b 100644
--- a/src/catch2/internal/catch_clara.hpp
+++ b/src/catch2/internal/catch_clara.hpp
@@ -673,7 +673,9 @@ namespace Catch {
template <typename T>
friend Parser operator|( Parser const& p, T&& rhs ) {
- return Parser( p ) |= CATCH_FORWARD(rhs);
+ Parser temp( p );
+ temp |= rhs;
+ return temp;
}
template <typename T>