Fix CXX23 compatibility issues
CXX23 is strict about the lhs operand, which means the current Catch version (1.9.6) used with testthat will cause multiple compilation errors not because of the tested package but because of the vendored Catch header.
This PR shows the scripts I used to use Catch2 with testthat.
I implemented this after noticing that cpp4r does not pass all tests when enforcing CXX23 with the GNU compiler.
Would you mind explaining what the root problem is and why it needs a ~18K line patch to fix it?
Would you mind explaining what the root problem is and why it needs a ~18K line patch to fix it?
yes, sorry the long detail but I am here to explain :)
- the current Catch library is severely outdated, I know it works but after going through Catch V1.9 documentation, it is clear that to anticipate to newer C++ standards it is better to use Catch 2
- testthat current Catch library is fully vendored, which is 100% ok as long as we do not use testthat with C++23
- after doing an almost direct copy and paste of the Catch 2 header, the git diff shows that many lines changed because, as Catch documentation says "we do not tweak the header because it is created after running a pipeline that calls many other files"
- after switching to Catch 2, we can use testthat with C++11 <= C++NN <= C++23
I know this PR reads "too forward", but once CRAN starts testing compiled code with C++23, this issue will show up. The current Catch 1.9 that testthat uses works perfectly well with <= C++20