Skip to content

Commit d1fdfe0

Browse files
author
Архипов Дмитрий
committed
compilation warning cleanup
1 parent e988c32 commit d1fdfe0

File tree

6 files changed

+15
-5
lines changed

6 files changed

+15
-5
lines changed

include/flags/flags.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ constexpr struct empty_t {
1919
} empty;
2020

2121

22-
template <class E> struct flags {
22+
template <class E> class flags {
2323
public:
2424
static_assert(is_flags<E>::value,
2525
"flags::flags is disallowed for this type; "

include/flags/flagsfwd.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define ENUM_CLASS_FLAGSFWD_HPP
33

44

5-
namespace flags { template <class E> struct flags; }
5+
namespace flags { template <class E> class flags; }
66

77

88
#endif // ENUM_CLASS_FLAGSFWD_HPP

include/flags/iterator.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class FlagsIterator {
3838
}
3939

4040

41-
constexpr reference operator*() noexcept {
41+
constexpr reference operator*() const noexcept {
4242
return static_cast<value_type>(mask_);
4343
}
4444

test/should-compile.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,13 @@ constexpr bool cf1 = ec1.empty();
145145
constexpr Enums::size_type cf2 = ec1.max_size();
146146
constexpr Enums::iterator cf3 = ec1.find(Enum::One);
147147
constexpr Enums::size_type cf4 = ec1.count(Enum::One);
148+
149+
150+
template <class... Ts> void ignore_variables(Ts&&...) {}
151+
152+
void do_ignore_variables() {
153+
ignore_variables(
154+
vc1, vc2, l1, l2, l3, l4, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11,
155+
b12, b13, cv1, cf1, cf2, cf3, cf4
156+
);
157+
}

test/shouldnt-compile/const-erase-iter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
void check() {
5-
const Enums es1;
5+
const auto es1 = Enums{};
66
Enum arr[] = {Enum::One};
77
es1.erase(arr);
88
}

test/shouldnt-compile/const-set-uv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33

44
void check() {
5-
const Enums es1;
5+
const auto es1 = Enums{};
66
es1.set_underlying_value(1);
77
}

0 commit comments

Comments
 (0)