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

    <tr>
        <th>Summary</th>
        <td>
            Clang++ crashes when using fmt on object with consteval constructor
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          jack-interpret-cast
      </td>
    </tr>
</table>

<pre>
    Minimal working example:

https://godbolt.org/z/ErPn95a8T

```
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-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -std=c++20 <source> -isystem/opt/compiler-explorer/libs/fmt/trunk/include
1.      <eof> parser at end of file
2.      <source>:25:5: LLVM IR generation of declaration 'main'
3.      <source>:25:5: Generating code for declaration 'main'
 #0 0x000055fc6f47dd7f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x000055fc6f47bbb4 llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x367bbb4)
 #2 0x000055fc6f3b4b48 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
 #3 0x00007f5cd18ce3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #4 0x000055fc6f83ff0d clang::CodeGen::ConstantEmitter::tryEmitPrivate(clang::APValue const&, clang::QualType) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3a3ff0d)
 #5 0x000055fc6f840ad5 clang::CodeGen::ConstantEmitter::tryEmitConstantExpr(clang::ConstantExpr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3a40ad5)
 #6 0x000055fc6fb4013a (anonymous namespace)::AggExprEmitter::VisitConstantExpr(clang::ConstantExpr*) CGExprAgg.cpp:0:0
 #7 0x000055fc6fb3e2eb clang::StmtVisitorBase<std::add_pointer, (anonymous namespace)::AggExprEmitter, void>::Visit(clang::Stmt*) CGExprAgg.cpp:0:0
 #8 0x000055fc6fb40351 clang::CodeGen::CodeGenFunction::EmitAggExpr(clang::Expr const*, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d40351)
 #9 0x000055fc6fb32561 clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(clang::Expr const*, clang::CodeGen::Address, clang::Qualifiers, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d32561)
#10 0x000055fc6fb36b06 clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(clang::MaterializeTemporaryExpr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d36b06)
#11 0x000055fc6fb2d53e clang::CodeGen::CodeGenFunction::EmitLValue(clang::Expr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d2d53e)
#12 0x000055fc6fb366dd clang::CodeGen::CodeGenFunction::EmitReferenceBindingToExpr(clang::Expr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d366dd)
#13 0x000055fc6fac5954 clang::CodeGen::CodeGenFunction::EmitCallArg(clang::CodeGen::CallArgList&, clang::Expr const*, clang::QualType) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cc5954)
#14 0x000055fc6fac6f8f clang::CodeGen::CodeGenFunction::EmitCallArgs(clang::CodeGen::CallArgList&, clang::CodeGen::CodeGenFunction::PrototypeWrapper, llvm::iterator_range<clang::Stmt::CastIterator<clang::Expr, clang::Expr const* const, clang::Stmt const* const>>, clang::CodeGen::CodeGenFunction::AbstractCallee, unsigned int, clang::CodeGen::CodeGenFunction::EvaluationOrder) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3cc6f8f)
#15 0x000055fc6fb2b79e clang::CodeGen::CodeGenFunction::EmitCall(clang::QualType, clang::CodeGen::CGCallee const&, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot, llvm::Value*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d2b79e)
#16 0x000055fc6fb38368 clang::CodeGen::CodeGenFunction::EmitCallExpr(clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d38368)
#17 0x000055fc6fb74960 (anonymous namespace)::ScalarExprEmitter::VisitCallExpr(clang::CallExpr const*) CGExprScalar.cpp:0:0
#18 0x000055fc6fb68df3 (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#19 0x000055fc6fb69cba (anonymous namespace)::ScalarExprEmitter::Visit(clang::Expr*) CGExprScalar.cpp:0:0
#20 0x000055fc6fb6b373 clang::CodeGen::CodeGenFunction::EmitScalarExpr(clang::Expr const*, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d6b373)
#21 0x000055fc6fb1d767 clang::CodeGen::CodeGenFunction::EmitAnyExpr(clang::Expr const*, clang::CodeGen::AggValueSlot, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d1d767)
#22 0x000055fc6fb36841 clang::CodeGen::CodeGenFunction::EmitIgnoredExpr(clang::Expr const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3d36841)
#23 0x000055fc6f85b51c clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*, llvm::ArrayRef<clang::Attr const*>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3a5b51c)
#24 0x000055fc6f86110c clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt const&, bool, clang::CodeGen::AggValueSlot) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3a6110c)
#25 0x000055fc6f8b40f3 clang::CodeGen::CodeGenFunction::EmitFunctionBody(clang::Stmt const*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3ab40f3)
#26 0x000055fc6f8bcc3c clang::CodeGen::CodeGenFunction::GenerateCode(clang::GlobalDecl, llvm::Function*, clang::CodeGen::CGFunctionInfo const&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3abcc3c)
#27 0x000055fc6f903c28 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3b03c28)
#28 0x000055fc6f900885 clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3b00885)
#29 0x000055fc6f900fc3 clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3b00fc3)
#30 0x000055fc6f9070f1 clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) (.part.5860) CodeGenModule.cpp:0:0
#31 0x000055fc70491361 (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) ModuleBuilder.cpp:0:0
#32 0x000055fc70484ac2 clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4684ac2)
#33 0x000055fc713d0484 clang::ParseAST(clang::Sema&, bool, bool) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x55d0484)
#34 0x000055fc7048fbad clang::CodeGenAction::ExecuteAction() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x468fbad)
#35 0x000055fc6fe6c551 clang::FrontendAction::Execute() (/opt/compiler-explorer/clang-trunk/bin/clang+++0x406c551)
#36 0x000055fc6fe03e32 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4003e32)
#37 0x000055fc6ff39753 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x4139753)
#38 0x000055fc6d0090a4 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x12090a4)
#39 0x000055fc6d00507d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#40 0x000055fc6fc953f5 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::'lambda'()>(long) Job.cpp:0:0
#41 0x000055fc6f3b5133 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x35b5133)
#42 0x000055fc6fc974c8 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e974c8)
#43 0x000055fc6fc6632a clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e6632a)
#44 0x000055fc6fc66e6f clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) const (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e66e6f)
#45 0x000055fc6fc6fba5 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*>>&) (/opt/compiler-explorer/clang-trunk/bin/clang+++0x3e6fba5)
#46 0x000055fc6cf32693 main (/opt/compiler-explorer/clang-trunk/bin/clang+++0x1132693)
#47 0x00007f5cd137c0b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#48 0x000055fc6d004bfa _start (/opt/compiler-explorer/clang-trunk/bin/clang+++0x1204bfa)
clang-15: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Compiler returned: 139
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlWl1v2zgW_TXOC-FA3x8PeXCcNJtFisk2QefRoCjK1lQWBZJK7fn1e0nKjqjYTuJqigW2SFKJpMhzDq_uvaSYsXx79bWsyzWu0E_Gf5T1EtENXjcVnfiziXMzcbq_Kykbocq8L_CzZHnGKnnJ-BLu_obfW_5YpyFOnvsPTSKn-9G3jw-3s6dbJNpsXUqEUdYuEacN4xJJhgYjlHLVZpeEreGmql52_00bzv6iRMJtKURLBVwgXOeorEnV5hTJFUWEY7FCGSY_JMeETrw5amAgzggVguZIsJabYvUkFoKREkuo4G2NBOFlIy8N5CcJnaC8XTd7PRyoSh85W3K8Rpgv2zWtpQKOAAprFDJA3ZQV5VO6aSrGKVdlFa6XUwkj_IC7rKx3ZRPvGn7QdJn_xLyYBnCFpkx1hptGddnKppWXAk3XSgA0nW6SaIrFeiq2tcSbiX9T1pJWaPoEdUtCppKxiqwwDOHfnMSkGosaN2LFJJoWhEHFNC_xsmZClgSGLGo21WraxULm0Dcx0D0HTfx5p6l_i6al2ApJ1yeHrspMTV2xVg12qnRzaHR2lc7QMWWF6rXBXFCOsEQU5owVqIAuTUuva7mHAJPhhfBH_aKHh-9f0f03tKQ15ViWrFZP5xTE724nXrxWanmx6c8_2d9d1w-8KoSBwRWMn-wNCnwHORsH_oVhQaIiiPM8LtAjh3nTBvasrPSpXNa4-hdYZKUUSl5YmU88eB1SZKrEJWmUGTr6d9-3O-g7y7IA6TcGLNafwVyYi3lFcd02f9SmNxihrQVcgtlXTJlhCr0lv2LD8ONs_EgjgO5eIXoWRD8LsiBBc2VW3yhhL5Rvh-RBGQXIajNnYOYbeVgFvxsiLkKSuwmhPnHQYsGpkAB-AS7GkAO7g7_wBi2iYFqVdbuZLuvWVDRyxSnOLwW7dDQXN4BeLCaBxSTxi8LJkZHAiAwWAQayu6mFxLW8BXcngZYulHyr7m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