Skip to content

Commit 2b4693d

Browse files
committed
Fix clang-tidy warnings
1 parent b08de16 commit 2b4693d

File tree

7 files changed

+8
-6
lines changed

7 files changed

+8
-6
lines changed

include/lexy/_detail/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ template <typename T>
5050
std::add_rvalue_reference_t<T> declval();
5151

5252
template <typename T>
53-
constexpr void swap(T& lhs, T& rhs)
53+
constexpr void swap(T& lhs, T& rhs) noexcept
5454
{
5555
T tmp = LEXY_MOV(lhs);
5656
lhs = LEXY_MOV(rhs);

include/lexy/_detail/memory_resource.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <lexy/_detail/config.hpp>
1010
#include <new>
1111

12-
#if 0
12+
#if 0 // NOLINT
1313
// Subset of the interface of std::pmr::memory_resource.
1414
class MemoryResource
1515
{

include/lexy/encoding.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace lexy
1313
{
1414
/// The endianness used by an encoding.
15-
enum class encoding_endianness
15+
enum class encoding_endianness // NOLINT(performance-enum-size)
1616
{
1717
/// Little endian.
1818
little,

src/input/file.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
#include <cerrno>
88
#include <cstdio>
9+
#include <lexy/_detail/assert.hpp>
910
#include <lexy/_detail/buffer_builder.hpp>
11+
#include <lexy/input/buffer.hpp>
1012

1113
#if defined(__unix__) || defined(__APPLE__)
1214

@@ -68,7 +70,7 @@ lexy::file_error lexy::_detail::read_file(const char* path, file_callback cb, vo
6870
return get_file_error();
6971

7072
auto off = ::lseek(fd, 0, SEEK_END);
71-
if (off == static_cast<::off_t>(-1))
73+
if (off == static_cast<decltype(off)>(-1))
7274
return lexy::file_error::os_error;
7375
auto size = static_cast<std::size_t>(off);
7476

tests/doctest_main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (C) 2020-2024 Jonathan Müller and lexy contributors
22
// SPDX-License-Identifier: BSL-1.0
33

4-
#include <lexy/_detail/config.hpp>
5-
64
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
75
#include <doctest/doctest.h>
86

tests/lexy/detail/buffer_builder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <lexy/_detail/buffer_builder.hpp>
55

6+
#include <cstring>
67
#include <doctest/doctest.h>
78

89
TEST_CASE("_detail::buffer_builder")

tests/lexy/detail/integer_sequence.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <lexy/_detail/integer_sequence.hpp>
55

66
#include <doctest/doctest.h>
7+
#include <type_traits>
78

89
TEST_CASE("_detail::integer_sequence")
910
{

0 commit comments

Comments
 (0)