Skip to content

Commit f871505

Browse files
committed
clang-tidy: add NOLInt to macro usage and the errors in there
1 parent 92095fc commit f871505

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/helper/utils.hpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,13 @@ namespace utils {
120120
#define UNUSED(x) (void(x)) // NOLINT(cppcoreguidelines-macro-usage)
121121

122122
#if !defined(NDEBUG)
123-
#define UNREACHABLE() /* NOLINT(cppcoreguidelines-macro-usage)*/ \
124-
do { \
125-
std::cerr << "UNREACHABLE " << (__FILE__) << ":" << (__LINE__) << " - " << (__FUNCTION__) << "\n"; \
126-
utils::unreachable(); \
123+
#define UNREACHABLE() /* NOLINT(cppcoreguidelines-macro-usage)*/ \
124+
do { /* NOLINT(cppcoreguidelines-avoid-do-while)*/ \
125+
std::cerr << "UNREACHABLE " << (__FILE__) /* NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)*/ \
126+
<< ":" << (__LINE__) << " - " \
127+
<< (__FUNCTION__) /* NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay)*/ \
128+
<< "\n"; \
129+
utils::unreachable(); \
127130
} while (false)
128131
#else
129132
#define UNREACHABLE() utils::unreachable // NOLINT(cppcoreguidelines-macro-usage)

0 commit comments

Comments
 (0)