hokein added inline comments.

================
Comment at: clang-tools-extra/clangd/refactor/tweaks/SpecialMembers.cpp:72
+//
+// e.g. given `struct S{};`, produces:
+//   struct S {
----------------
nit: add trigger points.


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/SpecialMembers.cpp:120
+    // they should be =default or =delete.
+    Inputs.AST->getSema().ForceDeclarationOfImplicitMembers(Class);
+    std::string Code = buildSpecialMemberDeclarations(*Class);
----------------
I think we need this because these members are created lazily in clang, e.g. if 
the empty struct `s` is not used, there is no constructor decl being created.

The `ForceDeclarationOfImplicitMembers` is a member function which can mutate 
the parameter `Class`, I was wondering whether it would lead some bad 
side-effect, but I didn't come out one (and the mutation is mostly creating a 
new ctor-decl and adding it to the Class).


================
Comment at: clang-tools-extra/clangd/refactor/tweaks/SpecialMembers.cpp:146
+private:
+  bool NeedCopy, NeedMove;
+  CXXRecordDecl *Class = nullptr;
----------------
nit: add default value


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116490/new/

https://reviews.llvm.org/D116490

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

Reply via email to