Skip to content

Commit 334bcd2

Browse files
authored
#972: Enable -Wdeprecated-literal-operator if supported. (#974)
Enable `-Wdeprecated-literal-operator` if supported. Switch to Debian `stable` because the breakage has seeped into `testing`.
1 parent 8ea1c00 commit 334bcd2

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
jobs:
44
build:
55
docker:
6-
- image: debian:testing
6+
- image: debian:stable
77
environment:
88
- PGHOST: "/tmp"
99
steps:

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17164,6 +17164,7 @@ then
1716417164
-Wanalyzer-write-to-string-literal \
1716517165
-fnothrow-opt \
1716617166
-Wattribute-alias=2 \
17167+
-Wdeprecated-literal-operator \
1716717168
-Wlogical-op \
1716817169
-Wmismatched-tags \
1716917170
-Wredundant-tags \

configure.ac

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ then
186186
-Wanalyzer-write-to-string-literal \
187187
-fnothrow-opt \
188188
-Wattribute-alias=2 \
189+
-Wdeprecated-literal-operator \
189190
-Wlogical-op \
190191
-Wmismatched-tags \
191192
-Wredundant-tags \

include/pqxx/zview.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public:
108108
* using pqxx::operator"" _zv;
109109
* ```
110110
*/
111-
constexpr zview operator"" _zv(char const str[], std::size_t len) noexcept
111+
constexpr zview operator""_zv(char const str[], std::size_t len) noexcept
112112
{
113113
return zview{str, len};
114114
}

test/runner.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ int main(int argc, char const *argv[])
172172
{
173173
// TODO: Accept multiple names.
174174
std::string_view test_name;
175-
if (argc > 1) test_name = argv[1];
175+
if (argc > 1)
176+
test_name = argv[1];
176177

177178
auto const num_tests{std::size(*all_test_names)};
178179
std::map<std::string_view, pqxx::test::testfunc> all_tests;
@@ -200,8 +201,7 @@ int main(int argc, char const *argv[])
200201
catch (pqxx::test::test_failure const &e)
201202
{
202203
std::cerr << "Test failure in " << e.file() << " line "
203-
<< pqxx::to_string(e.line()) << ": " << e.what()
204-
<< '\n';
204+
<< pqxx::to_string(e.line()) << ": " << e.what() << '\n';
205205
}
206206
catch (std::bad_alloc const &)
207207
{

test/test_helpers.hxx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ inline void check_not_equal(
157157
#if !defined(PQXX_HAVE_SOURCE_LOCATION)
158158
char const file[], int line,
159159
#endif
160-
VALUE1 const &value1, char const text1[], VALUE2 const &value2, char const text2[],
161-
std::string const &desc
160+
VALUE1 const &value1, char const text1[], VALUE2 const &value2,
161+
char const text2[], std::string const &desc
162162
#if defined(PQXX_HAVE_SOURCE_LOCATION)
163163
,
164164
std::source_location loc = std::source_location::current()
@@ -201,8 +201,8 @@ inline void check_less(
201201
#if !defined(PQXX_HAVE_SOURCE_LOCATION)
202202
char const file[], int line,
203203
#endif
204-
VALUE1 const &value1, char const text1[], VALUE2 const &value2, char const text2[],
205-
std::string const &desc
204+
VALUE1 const &value1, char const text1[], VALUE2 const &value2,
205+
char const text2[], std::string const &desc
206206
#if defined(PQXX_HAVE_SOURCE_LOCATION)
207207
,
208208
std::source_location loc = std::source_location::current()
@@ -248,8 +248,8 @@ inline void check_less_equal(
248248
#if !defined(PQXX_HAVE_SOURCE_LOCATION)
249249
char const file[], int line,
250250
#endif
251-
VALUE1 const &value1, char const text1[], VALUE2 const &value2, char const text2[],
252-
std::string const &desc
251+
VALUE1 const &value1, char const text1[], VALUE2 const &value2,
252+
char const text2[], std::string const &desc
253253
#if defined(PQXX_HAVE_SOURCE_LOCATION)
254254
,
255255
std::source_location loc = std::source_location::current()
@@ -376,8 +376,9 @@ inline void check_bounds(
376376
#if !defined(PQXX_HAVE_SOURCE_LOCATION)
377377
char const file[], int line,
378378
#endif
379-
VALUE const &value, char const text[], LOWER const &lower, char const lower_text[],
380-
UPPER const &upper, char const upper_text[], std::string const &desc
379+
VALUE const &value, char const text[], LOWER const &lower,
380+
char const lower_text[], UPPER const &upper, char const upper_text[],
381+
std::string const &desc
381382
#if defined(PQXX_HAVE_SOURCE_LOCATION)
382383
,
383384
std::source_location loc = std::source_location::current()

test/unit/test_row.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ void test_row_iterator()
6060

6161
void test_row_as()
6262
{
63-
using pqxx::operator"" _zv;
63+
using pqxx::operator""_zv;
6464

6565
pqxx::connection cx;
6666
pqxx::work tx{cx};

test/unit/test_zview.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ namespace
77
{
88
void test_zview_literal()
99
{
10-
using pqxx::operator"" _zv;
10+
using pqxx::operator""_zv;
1111

1212
PQXX_CHECK_EQUAL(("foo"_zv), pqxx::zview{"foo"}, "zview literal is broken.");
1313
}
1414

1515

1616
void test_zview_converts_to_string()
1717
{
18-
using pqxx::operator"" _zv;
18+
using pqxx::operator""_zv;
1919
using traits = pqxx::string_traits<pqxx::zview>;
2020

2121
PQXX_CHECK_EQUAL(

0 commit comments

Comments
 (0)