Issue 97405
Summary [clang-tidy] False negative readability-redundant-member-init with compiler-generated constructor
Labels clang-tidy
Assignees
Reporter chrchr-github
    ~~~c++
struct S1 {
    int a{}, b{};
};

struct S2 {
    int x, y;
 S2() : x{}, y{} {}
};

struct T {
    S1 s1{};
    S2 s2{}; // warning
};
~~~
~~~
[<source>:12:10: warning: initializer for member 's2' is redundant [readability-redundant-member-init]
   12 | S2 s2{}; // warning
      |          ^~
~~~
I would expect warnings also for `s1`.
https://godbolt.org/z/Gbn8YYdnG
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to