File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 1+ #define __SIZEOF_PTHREAD_MUTEX_T 40
2+
3+ namespace std {
4+ typedef union {
5+ struct __pthread_mutex_s {
6+ int __lock;
7+ unsigned int __count;
8+ } __data;
9+ char __size[__SIZEOF_PTHREAD_MUTEX_T];
10+ long int __align;
11+ } pthread_mutex_t ;
12+ };
Original file line number Diff line number Diff line change 11// RUN: %check_clang_tidy -std=c++98-or-later %s bugprone-tagged-union-member-count %t -- -- \
2+ // RUN: -I%S/Inputs/tagged-union-member-count \
23// RUN: -isystem %S/Inputs/tagged-union-member-count/system
34// Test check with C++ features
45
@@ -322,3 +323,13 @@ struct SystemTypedefedUnionDataMemberShouldBeIgnored {
322323 MyEnum
323324 } EnumField;
324325};
326+
327+ // Filter when union or enum comes from the std namespace but not a system header
328+ #include " stdnamespace.h"
329+
330+ struct StdNameSpaceUnionDataMemberShouldBeIgnored {
331+ std::pthread_mutex_t Mutex;
332+ enum {
333+ MyEnum
334+ } EnumField;
335+ };
You can’t perform that action at this time.
0 commit comments