<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/132344>132344</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Crash with official test `CXX/special/class.inhctor/elsewhere.cpp` and virtual inheritance
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Rush10233
</td>
</tr>
</table>
<pre>
Start from clang-6: [https://godbolt.org/z/rYhh565es](https://godbolt.org/z/rYhh565es)
Generated by fuzzer trying to change non-virtual inheritance to virtual ones.
Seed Program: https://github.com/llvm/llvm-project/blob/main/clang/test/CXX/special/class.inhctor/elsewhere.cpp
Stack Dump:
```
UNREACHABLE executed at /root/llvm-project/clang/lib/Sema/SemaDeclCXX.cpp:9229!
#0 0x00005ca81194cd3a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x254cd3a)
#1 0x00005ca81194a976 llvm::sys::RunSignalHandlers() (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x254a976)
#2 0x00005ca81194ad15 SignalHandler(int) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x254ad15)
#3 0x00007ef419642520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x00007ef4196969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
#5 0x00007ef419642476 raise (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
#6 0x00007ef4196287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
#7 0x00005ca8118ea06a (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x24ea06a)
#8 0x00005ca81291b211 clang::Sema::BuildUsingShadowDecl(clang::Scope*, clang::UsingDecl*, clang::NamedDecl*, clang::UsingShadowDecl*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x351b211)
#9 0x00005ca812c73896 clang::TemplateDeclInstantiator::VisitUsingDecl(clang::UsingDecl*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x3873896)
#10 0x00005ca812c52847 clang::Sema::InstantiateClass(clang::SourceLocation, clang::CXXRecordDecl*, clang::CXXRecordDecl*, clang::MultiLevelTemplateArgumentList const&, clang::TemplateSpecializationKind, bool) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x3852847)
#11 0x00005ca812c63d7e clang::Sema::InstantiateClassTemplateSpecialization(clang::SourceLocation, clang::ClassTemplateSpecializationDecl*, clang::TemplateSpecializationKind, bool) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x3863d7e)
#12 0x00005ca812c9e5da clang::Sema::RequireCompleteTypeImpl(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x389e5da)
#13 0x00005ca812c9e9a5 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, clang::Sema::TypeDiagnoser&) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x389e9a5)
#14 0x00005ca812c9ec23 clang::Sema::RequireCompleteType(clang::SourceLocation, clang::QualType, unsigned int) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x389ec23)
#15 0x00005ca81289550f clang::Sema::ActOnUninitializedDecl(clang::Decl*) [clone .part.2280] (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x349550f)
#16 0x00005ca8125e76e9 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31e76e9)
#17 0x00005ca8125f70c4 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31f70c4)
#18 0x00005ca8125d2100 clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31d2100)
#19 0x00005ca8125d27f9 clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) [clone .part.167] (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31d27f9)
#20 0x00005ca8125d83fa clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31d83fa)
#21 0x00005ca8125d90eb clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31d90eb)
#22 0x00005ca8125cda72 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x31cda72)
#23 0x00005ca8123d97e8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x2fd97e8)
#24 0x00005ca811f1d366 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x2b1d366)
#25 0x00005ca811ee4eae clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x2ae4eae)
#26 0x00005ca811fba51a clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0x2bba51a)
#27 0x00005ca81013e430 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0xd3e430)
#28 0x00005ca8100b8d8e main (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0xcb8d8e)
#29 0x00007ef419629d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#30 0x00007ef419629e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#31 0x00005ca81013a3ea _start (/opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0+0xd3a3ea)
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-6.0.0/bin/clang-6.0 -cc1 -triple x86_64-unknown-linux-gnu -S -disable-free -main-file-name example.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -coverage-notes-file /app/output.gcno -resource-dir /opt/compiler-explorer/clang-assertions-6.0.0/lib/clang/6.0.0 -internal-isystem /opt/compiler-explorer/gcc-7.3.0/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0 -internal-isystem /opt/compiler-explorer/gcc-7.3.0/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-7.3.0/lib/gcc/x86_64-linux-gnu/7.3.0/../../../../include/c++/7.3.0/backward -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/clang-assertions-6.0.0/lib/clang/6.0.0/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /app -ferror-limit 19 -fmessage-length 0 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -mllvm --x86-asm-syntax=intel -o /app/output.s -x c++ <source>
1. <source>:45:11: current parser token ';'
2. <source>:42:29: instantiating class definition 'E<bool>'
clang-6.0: error: unable to execute command: Aborted (core dumped)
clang-6.0: error: clang frontend command failed due to signal (use -v to see invocation)
Compiler returned: 254
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMWl1z4ygW_TXkhcIlIUu2HvKgOPFM1_bO9CY9u71PKQRXNtMSaAAlTv_6LZAdWYo709mKd6cqlSh83HvOAS4XJGat3CiAS5ReofT6gnVuq83lbWe3cUST5KLU4unyzjHjcGV0g3nN1IZkKCkwSq-2zrUWJQWia0TXGy1KXbuZNhtE198QXZt_b7dploJF6TWiyx9vTnMUFSgqfgIFhjkQuHzCVfftGxjszJNUG-w05lumNoCVVuRBGtexGku1BSMdUxx8i0OxVmBnvck7AIE_Gb0xrPE0JqCk23bljOsG0XVdPxz-kNbo34E7RNdlrUtE1w2TCtF1EATRtQPrK1dfviC6ti1wyeq-2tqZVFvutEF0DbWFxy0YmPG23QNyjH_F113TehShCGXR_icqfvvl9qZY_VxcfbzBsAPeeTWYw14vrd1LfAdEtfQw76Bh-z_XwOvVly_Bc1LklOaIxt4bTSIc7aIoilLOlnGcz7lIGA70kwIlhX2y_cMnI5ULgD8bxgHR5dDIsMd7bZ0B1iCaIZpjRJeIrnUbUOmmlTUYAru21gbMASlh1oJxUitLslk0i7zEg7S-DNGraEfTgGo_NWgSTyCzfJGdgnzbqTu5Uaz-mSlRg7EB1fuD8_6fwdEpOBGneAQD0aVU7ixARJw-A0n2QBZQzeM8m9OURnuP_fzYLbP7bE5qqbod2aiur-Azq2dZsBi6PNubj-3lWV5x3LqtASbuv8q6fpvx0P_ZeDoFO19k2DBp4a2Q50djkY2t0uWiSjArtXFvsxo6PltdjEZ4CSzK2DsP5TwYffa4PPZI87ikcdzH436ih5Uenq46WYvfrFSbuy0T-tEvfESXx225bgHRAtHVsYnQp289rfqFNSBOV73wVLz7tE7SQPdZi3ykBV8kyzw7hvQZmrZmDjyeD8o6ppxkPgKH2n9KK90R1-V3JXhvGsuAdIhh0ZhHS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