Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Remove SourceLineInfo::empty()

Commit
ca4c6218d418fe38571e67a1c60453bb2ab26fe7
Author
Martin Hořeňovský ·
Parents
ac4958395c65

Files · Download .tar.gz

Changes

 docs/deprecations.md            | 8 --------
 include/internal/catch_common.h | 5 ++---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/docs/deprecations.md b/docs/deprecations.md
index 4101f739..c416ad6d 100644
--- a/docs/deprecations.md
+++ b/docs/deprecations.md
@@ -9,14 +9,6 @@ either of these is a breaking change, and thus will not happen until
 at least the next major release.
 
 
-## Deprecations
-
-### SourceLineInfo::empty()
-
-There should be no reason to ever have an empty `SourceLineInfo`, so the
-method will be removed.
-
-
 ## Planned changes
 
 ### `CHECKED_IF` and `CHECKED_ELSE`
diff --git a/include/internal/catch_common.h b/include/internal/catch_common.h
index 5e097fbf..b4ca1c12 100644
--- a/include/internal/catch_common.h
+++ b/include/internal/catch_common.h
@@ -47,8 +47,8 @@ namespace Catch {
     struct SourceLineInfo {
 
         SourceLineInfo() = delete;
-        SourceLineInfo( char const* _file, std::size_t _line ) noexcept
-        :   file( _file ),
+        constexpr SourceLineInfo( char const* _file, std::size_t _line ) noexcept:
+            file( _file ),
             line( _line )
         {}
 
@@ -57,7 +57,6 @@ namespace Catch {
         SourceLineInfo( SourceLineInfo&& )              noexcept = default;
         SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
 
-        bool empty() const noexcept { return file[0] == '\0'; }
         bool operator == ( SourceLineInfo const& other ) const noexcept;
         bool operator < ( SourceLineInfo const& other ) const noexcept;