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

    <tr>
        <th>Summary</th>
        <td>
            Crash: Clang-15 crash in `clang::ASTRecordWriter::AddASTTemplateArgumentListInfo`
        </td>
    </tr>

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

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

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

<pre>
    ```
Stack dump:
0.      Program arguments: /usr/lib/llvm-15/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-pch -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name Decayer.h -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/data/clangd -resource-dir /usr/lib/llvm-15/lib/clang/15.0.3 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11 -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/backward -internal-isystem /usr/lib/llvm-15/lib/clang/15.0.3/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -std=c++20 -fdeprecated-macro -fdebug-compilation-dir=/data/clangd -ferror-limit 19 -fgnuc-version=4.2.1 -fno-implicit-modules -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o Decayer.h.gch -x c++-header Decayer.h
1.      <eof> parser at end of file
2.      serializing '(anonymous)'
 #0 0x00007fb940e49ee1 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf01ee1)
 #1 0x00007fb940e47c1e llvm::sys::RunSignalHandlers() (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xeffc1e)
 #2 0x00007fb940e4a40b (/usr/lib/llvm-15/bin/../lib/libLLVM-15.so.1+0xf0240b)
 #3 0x00007fb94a964420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
 #4 0x00007fb9493dd08e clang::ASTRecordWriter::AddASTTemplateArgumentListInfo(clang::ASTTemplateArgumentListInfo const*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x250408e)
 #5 0x00007fb949414dcb clang::ASTStmtWriter::VisitConceptSpecializationExpr(clang::ConceptSpecializationExpr*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x253bdcb)
 #6 0x00007fb94942117b clang::ASTWriter::WriteSubStmt(clang::Stmt*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x254817b)
 #7 0x00007fb949421d38 clang::ASTRecordWriter::FlushStmts() (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x2548d38)
 #8 0x00007fb9494108c9 (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x25378c9)
 #9 0x00007fb949410559 clang::ASTWriter::WriteDecl(clang::ASTContext&, clang::Decl*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x2537559)
#10 0x00007fb9493d6c69 clang::ASTWriter::WriteASTCore(clang::Sema&, llvm::StringRef, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::Module*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x24fdc69)
#11 0x00007fb9493d2e2e clang::ASTWriter::WriteAST(clang::Sema&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, clang::Module*, llvm::StringRef, bool, bool) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x24f9e2e)
#12 0x00007fb949423546 clang::PCHGenerator::HandleTranslationUnit(clang::ASTContext&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x254a546)
#13 0x00007fb9495c679c clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x26ed79c)
#14 0x00007fb94796581b clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0xa8c81b)
#15 0x00007fb949588cb7 clang::FrontendAction::Execute() (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x26afcb7)
#16 0x00007fb9494fcca6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x2623ca6)
#17 0x00007fb9496066ba clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm-15/bin/../lib/libclang-cpp.so.15+0x272d6ba)
#18 0x000055ea1beca91f cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-15/bin/clang+0x1391f)
#19 0x000055ea1bec8b1b (/usr/lib/llvm-15/bin/clang+0x11b1b)
#20 0x000055ea1bec896c clang_main(int, char**) (/usr/lib/llvm-15/bin/clang+0x1196c)
#21 0x00007fb93f9f4083 __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:342:3
#22 0x000055ea1bec532e _start (/usr/lib/llvm-15/bin/clang+0xe32e)
clang: error: unable to execute command: Segmentation fault (core dumped)
```

## How to reproduce:

#### Header:
```c++
// S.h
#pragma once

#include <concepts>

template<std::floating_point T, template<std::floating_point> typename Policy>
class S {
public:
    S(T initial, auto &&... args): _val(initial), _policy(args...) {}

private:
    Policy<T> _policy;
    T _val;
};
```
source:
```c++
// S.cpp
#include "S.h"


```

#### Compilation args
```
$ clang++-15 S.h S.cpp -std=c++20
```
## Machine
```
mchauhan@a-2pic45f2fjg2m:/data/clangd$ clang++-15 -v
Ubuntu clang version 15.0.3-++20221018073358+4a2c05b05ed0-1~exp1~20221018073409.79
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Selected multilib: .;@m64
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNWVtv27gS_jXOCyFBd1kPfnCcpC3QAkWd7T4aFEnZ3KMbKCl1-uvPR0q-SLm26z17gkC2yOHMN8PhzHCcVvxxMYuc4d-5mTnLdUvZfwjvinrmL_shxybm76uqtooWhKptV4iybUBBZt5d1yg8c5nqZ_5QWG6Ib6ks8WQ5LbfEYswlVqtknQuyn0ebKLBqZuWy7PbWtuyIJQrZYmhHLC4bmubCypQQWJgLqizatFYqskoJKwU8UfITnZH4IJTMpFBmmFHFrQead8IqaSEaYhVUllYm836A3AhGH4WyIa1QIq8YbWVVWkXFRU5qyYiFh5WLB7x6_Yts8AE8RQYLCKuuZNkKNfNvaJ4TKytou7OEUmWFl6y2WFW2irIWBFWJobKyVNWVXJZbS9OCEUiaVnWsraBfLmmjgWZd-UOW3Gq1arDvDcS3sLdoLVZ32nRWFGCoK4UZ2IoSmgMwF2m33QqlpyAEK7c8BT9WwTR0C-qqqGXeK8qlRo7d4bSlh02CSZVoqk4xoQle3tj-3azBpxvaju0Ty9ijpDks9di0ojit7x3Bto9Lt4zhObjB0Qc0L_dAOHnIkuUdF1rszLs2_yD-nwl9ZtW_guNcqOaNo_ADvv6a_Pds3knGq5xwTPL3kV5A6WdonwoWe_2FPQXw8ta9vvrXRRCraTkO07A1noMzx0WtEGFawXHWmarMEI7nu85ghi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