Skip to content

Commit e095d02

Browse files
committed
Fix code expecting what() to return a string_view
1 parent 445eeae commit e095d02

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/unit/test_macros.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ sequant::assert_failed("test");
2222
// initialized as default argument see
2323
// https://github.com/llvm/llvm-project/issues/56379
2424
#if !defined(SEQUANT_CXX_COMPILER_IS_CLANG) || __clang_major__ >= 16
25-
REQUIRE(ex.what().find("tests/unit/test_macros.cpp:1000 in function ") !=
25+
REQUIRE(std::string_view(ex.what()).find(
26+
"tests/unit/test_macros.cpp:1000 in function ") !=
2627
std::string::npos);
2728
#endif
2829
}
@@ -37,7 +38,8 @@ SEQUANT_ASSERT(1 == 0 && "1 != 0", "testing SEQUANT_ASSERT");
3738
// initialized as default argument see
3839
// https://github.com/llvm/llvm-project/issues/56379
3940
#if defined(SEQUANT_CXX_COMPILER_IS_CLANG) && __clang_major__ >= 16
40-
REQUIRE(ex.what().find("tests/unit/test_macros.cpp:2000 in function ") !=
41+
REQUIRE(std::string_view(ex.what()).find(
42+
"tests/unit/test_macros.cpp:2000 in function ") !=
4143
std::string::npos);
4244
#endif
4345
}

0 commit comments

Comments
 (0)