Skip to content

Commit

Permalink
Work around clang compile problem in a test.
Browse files Browse the repository at this point in the history
For some reason the line in this unit test where we create a
`std::vector<pqxx::binarystring>` triggers a deprecation warning, even
though the line is bracketed in an "ignore deprecations" block.

Since the whole class is deprecated, it wasn't really worth fixing
properly.  I'll just stop building this test on clang, until the time
comes to drop the whole class and its tests anyway.  Which I hope is
not too far off.
  • Loading branch information
jtv committed Oct 5, 2024
1 parent a4001ba commit cc7c4b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/unit/test_binarystring.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ void test_binarystring_stream()

void test_binarystring_array_stream()
{
// This test won't compile on clang in maintainer mode. For some reason,
// clang seems to ignore the ignore-deprecated headers in just this one
// function, where we create the vector of binarystring.
#if !defined(__clang__)
pqxx::connection cx;
pqxx::transaction tx{cx};
tx.exec("CREATE TEMP TABLE pqxxbinstream(id integer, vec bytea[])")
Expand Down Expand Up @@ -201,6 +205,7 @@ void test_binarystring_array_stream()
tx.query_value<std::size_t>(
"SELECT octet_length(vec[1]) FROM pqxxbinstream"),
std::size(data1), "Bytea length broke inside array.");
#endif // __clang__
}


Expand Down

0 comments on commit cc7c4b9

Please sign in to comment.