Issue 126841
Summary [clang-tidy] cppcoreguidelines-pro-type-member-init doesn't handle fields conditionally initailized in body well
Labels clang-tidy
Assignees
Reporter qqiangwu
    version: clang-tidy 18

the following code will not be flagged:

```cpp
struct X {
    int x = 0;
    int y;

    X();
};

X::X() {if (x>0) y = 0;}
```

but this will:
```cpp
struct X {
    int x = 0;
    int y;

    X();
};

X::X() {}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to