<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/112909>112909</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] Assertion `(!needsOverloadResolutionForCopyConstructor() || (data().DeclaredSpecialMembers & SMF_CopyConstructor)) && "this property has not yet been computed by Sema"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash-on-invalid,
            clang:frontend:fuzzer
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          yijan4845
      </td>
    </tr>
</table>

<pre>
    **This testcase is generated by a fuzzer.**

Compiler Explorer: [https://godbolt.org/z/orn1Y4799](https://godbolt.org/z/orn1Y4799)

This invalid code will crash on Clang Assertion Trunk, it seems that this goes back to clang-5:
```cpp
struct foo {
  foo(const foo&) = default;
};
struct bar : foo {
  virtual bar(const bar&) = default;
};
```

Stack dump:
```
clang++: /root/llvm-project/clang/include/clang/AST/DeclCXX.h:710: bool clang::CXXRecordDecl::defaultedCopyConstructorIsDeleted() const: Assertion `(!needsOverloadResolutionForCopyConstructor() || (data().DeclaredSpecialMembers & SMF_CopyConstructor)) && "this property has not yet been computed by Sema"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -fno-verbose-asm -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics <source>
1.      <source>:6:2: current parser token ';'
2.      <source>:4:1: parsing struct/union/class body 'bar'
 #0 0x0000000003bb5bd8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bb5bd8)
 #1 0x0000000003bb389c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3bb389c)
 #2 0x0000000003b00e88 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x000078b8cae42520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x000078b8cae969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x000078b8cae42476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x000078b8cae287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000078b8cae2871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x000078b8cae39e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000006b5ef75 clang::Sema::CheckCompletedCXXClass(clang::Scope*, clang::CXXRecordDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b5ef75)
#10 0x0000000006b5f4f9 clang::Sema::ActOnFinishCXXMemberSpecification(clang::Scope*, clang::SourceLocation, clang::Decl*, clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributesView const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6b5f4f9)
#11 0x00000000066dee7d clang::Parser::ParseCXXMemberSpecification(clang::SourceLocation, clang::SourceLocation, clang::ParsedAttributes&, unsigned int, clang::Decl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66dee7d)
#12 0x00000000066e1523 clang::Parser::ParseClassSpecifier(clang::tok::TokenKind, clang::SourceLocation, clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, bool, clang::Parser::DeclSpecContext, clang::ParsedAttributes&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66e1523)
#13 0x00000000066b5d20 clang::Parser::ParseDeclarationSpecifiers(clang::DeclSpec&, clang::Parser::ParsedTemplateInfo&, clang::AccessSpecifier, clang::Parser::DeclSpecContext, clang::Parser::LateParsedAttrList*, clang::ImplicitTypenameContext) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66b5d20)
#14 0x0000000006673854 clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6673854)
#15 0x00000000066742be clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66742be)
#16 0x000000000667ba53 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x667ba53)
#17 0x000000000667c93d clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x667c93d)
#18 0x000000000666ee5a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x666ee5a)
#19 0x000000000452a5b8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x452a5b8)
#20 0x00000000047e4ce9 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47e4ce9)
#21 0x00000000047637de clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x47637de)
#22 0x00000000048ca48e clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x48ca48e)
#23 0x0000000000cddb4f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcddb4f)
#24 0x0000000000cd585a ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#25 0x000000000456e2c9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#26 0x0000000003b01334 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3b01334)
#27 0x000000000456e8bf clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (.part.0) Job.cpp:0:0
#28 0x00000000045341bd clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45341bd)
#29 0x00000000045352ad clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x45352ad)
#30 0x000000000453cbd5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x453cbd5)
#31 0x0000000000cdaa1f clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcdaa1f)
#32 0x0000000000ba9b14 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xba9b14)
#33 0x000078b8cae29d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#34 0x000078b8cae29e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#35 0x0000000000cd530e _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xcd530e)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWl1v27jS_jXMDSFDoj59kQtXrvftvl20aIJFzpVBUWObW5nUIanU6a8_ICUnopx4k0Xci3MKt5X5MXzmmeHMiCbVmm8FwDVKP6B0eUU7s5Pq-oH_RUVSJOlVJeuHa0QWiCxud1xjA9owqgFzjbcgQFEDNa4eMMWb7udPULN-MAqXKBz-LeW-5Q0o_PHQNlKBQvECo_TDzphWo3iByAqR1VbWlWzMTKotIqufiKykEtG_knw-R-kSkeL1w8l8vLzDzcU9bXiNmawB_-BNg5mieoelwGVDxRYvtAZluBT4VnXiOyIl5gZrgL3GZkcNNlbMVoLGFWXfsZGY2YlBaiH1y2Vh_2Ft27doozpm8EZKjPIPfRu2XxEpmBTa9M8ZInOM4iWuYUO7xqB4GIvy5ePzIKuiClv-JjLvuTIdbWz3o2z3_CrZj8jHvN0Yq2fd7dtTDfuvjgBEPtiPNSlZKSkNIqumud8HrZJ_AbNfh3ErLljT1TBqWdzcIrJaAmvKu7vZDsWLPAqtrErKpifYLh4vyru7b8Ckqu3YvmlQCOpStg-l1dgSJNUnvYQGDNSIFFZ5R4aV-WRiq4HtjARArb_cg2okrb-Blk1nB6ykmggdZKG8RHmJESlqamjfOLOQqIL6pgXGafMH7CtQGiOS4Zs_VusTSXMnyVomw4gQ51itki0o84B3VGMhDX4AgysAgZnct92wyW5gTxEhiOR4Q3kD9aw3xNfPHxc3H7Huqj03mOKq22IFrVTG-ulk43Cz66oZk_vBUKf24lp3oBFZYSpqPFgNmx0Mm8ZuAKMoA7tLWgWtkgy0hhpr2am-2c6kWkvGXYRQncCaKd6a2YveFc5QOP-q5FbRPaZq2-1BGD14lmydJw2hJIBjKBl8KaBH4-rA9Bt4VXHx5GrWSXGwrX9QtQkSHGxxIK1c2rZWemfazsw0DvaWCxwEhyILqN4H-kEYekDxkgsDDQ42Qgb3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