Skip to content

Commit a9f628d

Browse files
committed
Fix clang-tidy findings
1 parent e92e156 commit a9f628d

File tree

2 files changed

+18
-13
lines changed

2 files changed

+18
-13
lines changed

include/tao/operators.hpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ namespace tao
581581
template< typename T >
582582
class incrementable
583583
{
584-
friend T operator++(T& arg, int)noexcept( noexcept( T( arg ), ++arg, T( std::declval< T >() ) ) )
584+
friend T operator++( T& arg, int /*unused*/ ) noexcept( noexcept( T( arg ), ++arg, T( std::declval< T >() ) ) ) // NOLINT
585585
{
586586
const T nrv( arg );
587587
++arg;
@@ -592,7 +592,7 @@ namespace tao
592592
template< typename T >
593593
class decrementable
594594
{
595-
friend T operator--(T& arg, int)noexcept( noexcept( T( arg ), --arg, T( std::declval< T >() ) ) )
595+
friend T operator--( T& arg, int /*unused*/ ) noexcept( noexcept( T( arg ), --arg, T( std::declval< T >() ) ) ) // NOLINT
596596
{
597597
const T nrv( arg );
598598
--arg;
@@ -606,8 +606,10 @@ namespace tao
606606
decrementable< T >
607607
{
608608
};
609-
}
610-
}
609+
610+
} // namespace operators
611+
612+
} // namespace tao
611613

612614
#undef TAO_OPERATORS_BASIC_OP
613615
#undef TAO_OPERATORS_BASIC_OP_LEFT

src/test/operators/operators.cpp

+12-9
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@ class X
1919
{
2020
}
2121

22-
X( const X& x )
23-
noexcept
24-
: v_( x.v_ )
25-
{
26-
}
22+
X( const X& ) = default;
23+
X( X&& ) = default;
24+
25+
~X() = default;
26+
27+
X& operator=( const X& ) = delete;
28+
X& operator=( X&& ) = delete;
2729

2830
X& operator+=( const X& x ) noexcept
2931
{
@@ -118,24 +120,25 @@ class E
118120
{
119121
};
120122

121-
void adl_test( const E& ) {}
123+
void adl_test( const E& /*unused*/ ) {}
122124

123125
namespace tao
124126
{
125127
void adl_test( const E& );
126-
}
128+
129+
} // namespace tao
127130

128131
struct S
129132
: tao::operators::addable< S >
130133
{
131-
S() {}
134+
S() = default;
132135

133136
S( const S& a, const S& b )
134137
: S( a + b )
135138
{
136139
}
137140

138-
S& operator+=( const S& ) noexcept
141+
S& operator+=( const S& /*unused*/ ) noexcept
139142
{
140143
return *this;
141144
}

0 commit comments

Comments
 (0)