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

    <tr>
        <th>Summary</th>
        <td>
            [clang][bytecode] Assertion `R' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend,
            crash,
            clang:bytecode
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          k-arrows
      </td>
    </tr>
</table>

<pre>
    Reproducer:
https://godbolt.org/z/fE4z3oaf8
```cpp
struct a {
  a *p = this;
};

template <int N> struct b {
  a m[N][N];
};

template <int N> struct c : b<N> {
  constexpr c() : b<N>() {}
};

c<1> d;
```

Backtrace:
```console
clang++: /root/llvm-project/llvm/tools/clang/lib/AST/ByteCode/Interp.h:2791: bool clang::interp::This(clang::interp::InterpState&, clang::interp::CodePtr): Assertion `R' 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 -fexperimental-new-constant-interpreter <source>
1.      <source>:13:7: current parser token ';'
 #0 0x00000000040213f8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x40213f8)
 #1 0x000000000401e824 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x401e824)
 #2 0x0000000003f63058 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007ab72a042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007ab72a0969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007ab72a042476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007ab72a0287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x00007ab72a02871b (/lib/x86_64-linux-gnu/libc.so.6+0x2871b)
 #8 0x00007ab72a039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
 #9 0x0000000007b1adb3 clang::interp::This(clang::interp::InterpState&, clang::interp::CodePtr) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b1adb3)
#10 0x0000000007b99045 clang::interp::Interpret(clang::interp::InterpState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b99045)
#11 0x0000000007b9beac clang::interp::Call(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Function const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b9beac)
#12 0x0000000007b97265 clang::interp::Interpret(clang::interp::InterpState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b97265)
#13 0x0000000007b9beac clang::interp::Call(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Function const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b9beac)
#14 0x0000000007b97265 clang::interp::Interpret(clang::interp::InterpState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b97265)
#15 0x0000000007b9beac clang::interp::Call(clang::interp::InterpState&, clang::interp::CodePtr, clang::interp::Function const*, unsigned int) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7b9beac)
#16 0x0000000007e273f0 clang::interp::Compiler<clang::interp::EvalEmitter>::VisitCXXConstructExpr(clang::CXXConstructExpr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e273f0)
#17 0x0000000007e2694d clang::interp::Compiler<clang::interp::EvalEmitter>::visitInitializer(clang::Expr const*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e2694d)
#18 0x0000000007e27eaa clang::interp::Compiler<clang::interp::EvalEmitter>::visitVarDecl(clang::VarDecl const*, bool, bool)::'lambda0'(unsigned int)::operator()(unsigned int) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e27eaa)
#19 0x0000000007e283da clang::interp::Compiler<clang::interp::EvalEmitter>::visitVarDecl(clang::VarDecl const*, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e283da)
#20 0x0000000007e28834 clang::interp::Compiler<clang::interp::EvalEmitter>::visitDeclAndReturn(clang::VarDecl const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7e28834)
#21 0x00000000079cf2b7 clang::interp::EvalEmitter::interpretDecl(clang::VarDecl const*, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x79cf2b7)
#22 0x00000000079b114d clang::interp::Context::evaluateAsInitializer(clang::interp::State&, clang::VarDecl const*, clang::APValue&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x79b114d)
#23 0x0000000007989733 clang::Expr::EvaluateAsInitializer(clang::APValue&, clang::ASTContext const&, clang::VarDecl const*, llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x7989733)
#24 0x000000000779f412 clang::VarDecl::evaluateValueImpl(llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic>>&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x779f412)
#25 0x000000000779f7c1 clang::VarDecl::checkForConstantInitialization(llvm::SmallVectorImpl<std::pair<clang::SourceLocation, clang::PartialDiagnostic>>&) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x779f7c1)
#26 0x0000000006a9fa5b clang::Sema::CheckCompleteVariableDeclaration(clang::VarDecl*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6a9fa5b)
#27 0x0000000006aa12cf clang::Sema::ActOnUninitializedDecl(clang::Decl*) (.part.0) SemaDecl.cpp:0:0
#28 0x000000000670999b clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x670999b)
#29 0x0000000006718d19 clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::ParsedAttributes&, clang::Parser::ParsedTemplateInfo&, clang::SourceLocation*, clang::Parser::ForRangeInit*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x6718d19)
#30 0x00000000066d676e clang::Parser::ParseDeclOrFunctionDefInternal(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec&, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d676e)
#31 0x00000000066d6f0f clang::Parser::ParseDeclarationOrFunctionDefinition(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*, clang::AccessSpecifier) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d6f0f)
#32 0x00000000066de783 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66de783)
#33 0x00000000066df695 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66df695)
#34 0x00000000066d179a clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x66d179a)
#35 0x00000000049c32f8 clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49c32f8)
#36 0x0000000004cb7355 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4cb7355)
#37 0x0000000004c335ae clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4c335ae)
#38 0x0000000004da8971 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x4da8971)
#39 0x0000000000daff4f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdaff4f)
#40 0x0000000000da6baa ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#41 0x0000000004a2ad09 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
#42 0x0000000003f634f4 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3f634f4)
#43 0x0000000004a2b31f 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
#44 0x00000000049ed58d clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49ed58d)
#45 0x00000000049ee61e 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+++0x49ee61e)
#46 0x00000000049f60b5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x49f60b5)
#47 0x0000000000dac405 clang_main(int, char**, llvm::ToolContext const&) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xdac405)
#48 0x0000000000c60394 main (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xc60394)
#49 0x00007ab72a029d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#50 0x00007ab72a029e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#51 0x0000000000da6655 _start (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0xda6655)
clang++: error: clang frontend command failed with exit code 134 (use -v to see invocation)
Compiler returned: 134
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzsW11z4ygW_TXkhZJLAn0-5EFx4tme6p3uSrJd8-ZCCNnayEILKO3Mr99CSJaQ7XRnK07N7s5UT0UWcDnn3AtcMCZSlpuasWsQ3IDg9oq0asvF9ZNDhODf5VXG85fre9YInreUCYBT4KZbpRqpH9EKoNWG5xmv1IKLDUCrPwBaFXf-H5iTIgZuCkLX_KNNA9xUKtFSBQkE0Q1wU6ifUNpAgG-h2pYSYP0aRLf9g5sqtmsqohgEeFnWCv4G8B3szWQTMzsQ3PwGgtvhz5sMUQhwCjOAl93bwSrltVRs3whIAYoBSqxqw6voRndjd0YBXnraVN6_GmQwxTeEPilBKDOCjiLxWvKKaQMVqTcA3eh_OIUArQTnCqBVVT3vnEbwfzI6fARopTivJECrvtmqKjOAVunDI0CrmxfFljxnAK0-1YqJZrEFOEVR4nVsOK-gaYZTgNOyq2KeH7VHUHym1Bh7UEQxgEKAlufM6M6_KgFQojtMpWRClbyGIHTvAYpgQcqK5Qvgpl8_36UPd1C22a7UUZK1GyhYw4WCisNZ3JVq22YLynejDDNxSilbpmWBpM5hWdOqzRlUWwapIHILs4Mb0BI2Qoc5ZVKyHEreCvNatyRScloSxXIo2hpKKspGabwPitAnmLe7xjjSXQA3-Sr4RpAdJGLT7litZO9A3mhMlO-asmLCYfum4oKJwWsOGYSRjhJt_QTQK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