Skip to content

Commit a2298a2

Browse files
committed
fix build: fix userver-ydb build on certain compilers with C++20
commit_hash:333a6b927b26b33f3d8ba9bed88a24c8eb56878c
1 parent 0554134 commit a2298a2

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ endif()
9090
set(USERVER_YDB_DEFAULT OFF)
9191
if(USERVER_FEATURE_CORE AND USERVER_BUILD_ALL_COMPONENTS)
9292
set(USERVER_YDB_DEFAULT ON)
93+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13.1")
94+
# ydb-cpp-sdk requires <format> header support, and GCC only implemented it in 13.1.
95+
set(USERVER_YDB_DEFAULT OFF)
96+
endif()
9397
endif()
9498

9599
option(USERVER_CONAN "Build with Conan packages" "${CONAN_EXPORTED}")

ydb/tests/scan_table_test.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ UTEST_F(YdbScanTable, Simple) {
1414

1515
auto results = GetTableClient().ExecuteScanQuery("SELECT * FROM test_table ORDER BY key");
1616

17-
auto cursor = results.GetNextCursor();
18-
ASSERT_TRUE(cursor);
19-
AssertArePreFilledRows(std::move(*cursor), {1, 2, 3});
17+
{
18+
auto cursor = results.GetNextCursor();
19+
ASSERT_TRUE(cursor);
20+
AssertArePreFilledRows(std::move(*cursor), {1, 2, 3});
21+
}
2022

21-
while (cursor = results.GetNextCursor()) {
23+
while (auto cursor = results.GetNextCursor()) {
2224
EXPECT_THAT(*cursor, testing::IsEmpty());
2325
}
2426
}

0 commit comments

Comments
 (0)