Source C file:
#include <pthread.h>
typedef enum {
MYENUM_ONE,
MYENUM_TWO,
} myEnumT;
typedef struct {
pthread_mutex_t mtx;
myEnumT my_enum;
} myTypeT;
Using clang-tidy bugprone-tagged-union-member-count:
<source>:8:9: warning: tagged union has more data members (3) than tags (2)! [bugprone-tagged-union-member-count]
8 | typedef struct {
| ^
1 warning generated.
This is incorrect warning.
clang-tidy vesion: 20.1.1
Issue also reproducible in this link:
https://godbolt.org/z/o3fb9bbrb