Sockke added inline comments.
================ Comment at: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp:534 + +union U2 { + U2() {} ---------------- aaron.ballman wrote: > A related interesting test would be: > ``` > union U3 { > U3() {} > > struct { > int B; > } b; > int A; > }; > ``` > I would expect `A` or `b` to need initialization for the union, and `B` to > need initialization for the struct. > A related interesting test would be: > ``` > union U3 { > U3() {} > > struct { > int B; > } b; > int A; > }; > ``` > I would expect `A` or `b` to need initialization for the union, and `B` to > need initialization for the struct. I apologize for the delay in responding. It seems to me that `struct {}b` has no user-defined constructor, so all members are initialized to their defaults, it is unnecessary to initialize `B` explicitly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108370/new/ https://reviews.llvm.org/D108370 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits