[Lldb-commits] [PATCH] D72694: [lldb] Mark the implicit copy constructor as deleted when a move constructor is provided.

Shafik Yaghmour via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 17 10:51:57 PST 2020


shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lldb/packages/Python/lldbsuite/test/commands/expression/deleting-implicit-copy-constructor/main.cpp:14
+  // should have propagated to this record and Clang won't crash.
+  IndirectlyDeletedCopyCstr() { //%self.dbg.GetCommandInterpreter().HandleCompletion("e ", len("e "), 0, -1, lldb.SBStringList())
+  }
----------------
Is this the only way to trigger the assert on the command line?


================
Comment at: lldb/source/Symbol/ClangASTContext.cpp:7786
     if (auto *cxx_record_decl = llvm::dyn_cast<CXXRecordDecl>(tag_decl)) {
+      // If we have a move constructor declared but no copy constructor we
+      // need to explicitly mark it as deleted. Usually Sema would do this for
----------------
There are other cases where special member functions should be deleted as well. I don't know if they will show up as asserts as well but it is unfortunate that we have to mirror the logic here. 


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

https://reviews.llvm.org/D72694





More information about the lldb-commits mailing list