Skip to content

Commit

Permalink
warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-kirienko committed Jun 26, 2024
1 parent 178d262 commit 87f9764
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions c++/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
# define NODISCARD [[nodiscard]]
# define UNUSED [[maybe_unused]]
#else
# define NODISCARD
# define UNUSED
# if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM)
# define NODISCARD __attribute__((warn_unused_result))
# define UNUSED __attribute__((unused))
# else
# define NODISCARD
# define UNUSED
# endif
#endif

void setUp() {}
Expand Down Expand Up @@ -60,9 +65,9 @@ class My : public cavl::Node<My>
// defined in the derived class. That would trigger compilation error in this case, but may be deadly in the field.
using E = struct
{};
UNUSED E up; // NOLINT(*-unused-private-field)
UNUSED E lr; // NOLINT(*-unused-private-field)
UNUSED E bf; // NOLINT(*-unused-private-field)
UNUSED E up;
UNUSED E lr;
UNUSED E bf;
};
using MyTree = cavl::Tree<My>;
static_assert(std::is_same<My::TreeType, MyTree>::value, "");
Expand Down Expand Up @@ -815,9 +820,9 @@ class V : public cavl::Node<V>
private:
using E = struct
{};
UNUSED E up; // NOLINT(*-unused-private-field)
UNUSED E lr; // NOLINT(*-unused-private-field)
UNUSED E bf; // NOLINT(*-unused-private-field)
UNUSED E up;
UNUSED E lr;
UNUSED E bf;
};
using VTree = cavl::Tree<V>;
static_assert(std::is_same<V::TreeType, VTree>::value, "");
Expand Down

0 comments on commit 87f9764

Please sign in to comment.