diff options
author | Klaus T. Aehlig <aehlig@linta.de> | 2025-06-13 16:37:40 +0200 |
---|---|---|
committer | Klaus T. Aehlig <aehlig@linta.de> | 2025-06-16 17:23:33 +0200 |
commit | a78bd0abe451cde450bbc1eb56c1450b350dc255 (patch) | |
tree | 744679bcb9b550ae79d2bb4461f9048f136020cb /src/buildtool/file_system/file_root.hpp | |
parent | f4d3c39d9a5efa066adba7da13bef39d846b556f (diff) | |
download | justbuild-a78bd0abe451cde450bbc1eb56c1450b350dc255.tar.gz |
Ensure equality operators are really noexcept.
... by explicitly catching any possible exception. Mainly to make clang-tidy
happy.
...
Diffstat (limited to 'src/buildtool/file_system/file_root.hpp')
-rw-r--r-- | src/buildtool/file_system/file_root.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/buildtool/file_system/file_root.hpp b/src/buildtool/file_system/file_root.hpp index 3384f55e..f8daa429 100644 --- a/src/buildtool/file_system/file_root.hpp +++ b/src/buildtool/file_system/file_root.hpp @@ -183,7 +183,20 @@ class FileRoot { friend auto operator==(Iterator const& x, Iterator const& y) noexcept -> bool { - return x.it_ == y.it_; + try { + return x.it_ == y.it_; + } catch (std::exception const& e) { + try { + Logger::Log(LogLevel::Error, + "Unexpected excpetion: {}", + e.what()); + std::terminate(); + } catch (...) { + std::terminate(); + } + } catch (...) { + std::terminate(); + } } friend auto operator!=(Iterator const& x, Iterator const& y) noexcept -> bool { |