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

Update vendered catch.h file to remove C++20 deprecated function #2060

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# testthat 3.2.3.9000

* Fixed use of the deprecated C++20 function `std::uncaught_exception()`
in the vendored Catch C++ unit testing library [@tylermorganwall, #2047]

# testthat 3.2.3

* Fixed an issue where `expect_no_error(1)` was failing (#2037).
Expand Down
4 changes: 2 additions & 2 deletions inst/include/testthat/vendor/catch.h
Original file line number Diff line number Diff line change
Expand Up @@ -8379,7 +8379,7 @@ namespace Catch {
{}

ScopedMessage::~ScopedMessage() {
if ( !std::uncaught_exception() ){
if ( std::uncaught_exceptions() == 0 ){
getResultCapture().popScopedMessage(m_info);
}
}
Expand Down Expand Up @@ -8702,7 +8702,7 @@ namespace Catch {
Section::~Section() {
if( m_sectionIncluded ) {
SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
if( std::uncaught_exception() )
if( std::uncaught_exceptions() > 0 )
getResultCapture().sectionEndedEarly( endInfo );
else
getResultCapture().sectionEnded( endInfo );
Expand Down
Loading