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

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 20 05:21:51 PST 2020

teemperor marked 2 inline comments as done.
teemperor added a comment.

Thanks for the review!

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())
+  }
shafik wrote:
> Is this the only way to trigger the assert on the command line?
Actually touching `IndirectlyDeletedCopyCstr` in any other way also does the trick (but it was found by completing in the constructor). I added an expression that just tries to create an instance which tests the same thing (and I keep the completing around as that's a very cheap test as it doesn't codegen/run anything).

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
shafik wrote:
> 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. 
Please add them as tests when you have time!



More information about the lldb-commits mailing list