Issue 134840
Summary [clang-tidy] bugprone-tagged-union-member-count false warning when using enum & pthread_mutex_t
Labels clang-tidy
Assignees
Reporter abdelmaged
    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

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to