Skip to content

Commit 77cc9fc

Browse files
thorsten-kleinkris-jusiak
authored andcommitted
added NOLINT for clang-tidy and clang address sanitizer
ignore clang-tidy rule: -clang-analyzer-core.NonNullParamChecker -clang-analyzer-core.CallAndMessage
1 parent 4ca2b63 commit 77cc9fc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

include/GUnit/GMock.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,17 @@ struct virtual_offset {
9696
template <class R, class B, class... TArgs>
9797
inline auto offset(R (B::*f)(TArgs...) const) {
9898
auto ptr = reinterpret_cast<std::size_t (virtual_offset::*)(int)>(f);
99-
return (virtual_offset{}.*ptr)(0);
99+
return (virtual_offset{}.*ptr)(0); // NOLINT
100100
}
101101

102102
template <class R, class B, class... TArgs>
103103
inline auto offset(R (B::*f)(TArgs...)) {
104104
auto ptr = reinterpret_cast<std::size_t (virtual_offset::*)(int)>(f);
105-
return (virtual_offset{}.*ptr)(0);
105+
return (virtual_offset{}.*ptr)(0); // NOLINT
106106
}
107107

108108
template <class T>
109+
__attribute__((no_sanitize("undefined")))
109110
inline auto dtor_offset() {
110111
virtual_offset offset;
111112
union_cast<T *>(&offset)->~T();

include/GUnit/GTest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ class GTest : public detail::GTest<T, TParamType> {};
286286
&__GUNIT_CAT(GTEST_GENERATE_NAMES, __LINE__))
287287

288288
#define GTEST(...) \
289-
__GUNIT_CAT(__GTEST_IMPL_, __GUNIT_SIZE(__VA_ARGS__))(false, __VA_ARGS__)
289+
__GUNIT_CAT(__GTEST_IMPL_, __GUNIT_SIZE(__VA_ARGS__))(false, __VA_ARGS__) // NOLINT
290290
#define DISABLED_GTEST(...) \
291-
__GUNIT_CAT(__GTEST_IMPL_, __GUNIT_SIZE(__VA_ARGS__))(true, __VA_ARGS__)
291+
__GUNIT_CAT(__GTEST_IMPL_, __GUNIT_SIZE(__VA_ARGS__))(true, __VA_ARGS__) // NOLINT
292292

293293
#define SHOULD(NAME) if (tr_gtest.run("SHOULD", NAME, __LINE__))
294294
#define DISABLED_SHOULD(NAME) if (tr_gtest.run("SHOULD", NAME, __LINE__, true))

0 commit comments

Comments
 (0)