brintos

brintos / llvm-project-archived public Read only

0
0
Text · 930 B · 1387a63 Raw
21 lines · cpp
1struct NoCopyCstr {2  NoCopyCstr() {}3  // No copy constructor but a move constructor means we have an4  // implicitly deleted copy constructor (C++11 [class.copy]p7, p18).5  NoCopyCstr(NoCopyCstr &&);6};7struct IndirectlyDeletedCopyCstr {8  // This field indirectly deletes the implicit copy constructor.9  NoCopyCstr field;10  // Completing in the constructor or constructing the class11  // will cause Sema to declare the special members of IndirectlyDeletedCopyCstr.12  // If we correctly set the deleted implicit copy constructor in NoCopyCstr then this13  // should have propagated to this record and Clang won't crash.14  IndirectlyDeletedCopyCstr() { //%self.expect_expr("IndirectlyDeletedCopyCstr x; 1+1", result_type="int", result_value="2")15                                //%self.dbg.GetCommandInterpreter().HandleCompletion("e ", len("e "), 0, -1, lldb.SBStringList())16  }17};18int main() {19  IndirectlyDeletedCopyCstr{};20}21