njames93 added inline comments.
================ Comment at: clang-tools-extra/clangd/refactor/tweaks/MemberwiseConstructor.cpp:26-28 +// struct S { +// S(int x, unique_ptr<double> y) : x(x), y(std::move(y)) {} +// }; ---------------- avogelsgesang wrote: > ``` > // e.g. given `struct S{ int x; unique_ptr<double> y; };`, produces: > // struct S { > // int x; unique_ptr<double> y; > // S(int x, unique_ptr<double> y) : x(x), y(std::move(y)) {} > // }; > ``` > or just > ``` > // e.g. given `struct S{ int x; unique_ptr<double> y; };`, produces: > // S(int x, unique_ptr<double> y) : x(x), y(std::move(y)) {} > ``` > > The tweak does not remove the members, as currently suggested by the comment That's just a bad comment, the tweak won't remove the members ================ Comment at: clang-tools-extra/clangd/refactor/tweaks/MemberwiseConstructor.cpp:49 + Class = N->ASTNode.get<CXXRecordDecl>(); + if (!Class || !Class->isThisDeclarationADefinition() || Class->isUnion()) + return false; ---------------- avogelsgesang wrote: > do we also need to exclude anonymous class declarations here? (Not sure if > those are also modelled as `CXXRecordDecl` in the clang AST...) Good point, should also ensure there is a test case for this as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D116514/new/ https://reviews.llvm.org/D116514 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits