<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/87958>87958</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Hang and Memory Consumption Issue during Clang-19.0.0.git Compilation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
iamanonymouscs
</td>
</tr>
</table>
<pre>
# Command
`clang bug_5.cc`
# Code
The compilation process hangs indefinitely without producing any output, and I noticed a continuous increase in memory consumption. The code snippet that triggers this problem is as follows:
```c
template<typename> using A = auto;
template<template<typename> class> struct B {};
B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
```
# Version
`clang --version`
```sh
clang version 19.0.0git (https://github.com/llvm/llvm-project.git 987087df90026605fc8d03ebda5a1cd31b71e609)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
# Output
```sh
bug_5.cc:1:30: error: 'auto' not allowed in type alias
1 | template<typename> using A = auto;
| ^~~~
bug_5.cc:5:129: error: too few template arguments for class template 'B'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:3:43: note: template is declared here
3 | template<template<typename> class> struct B {};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
bug_5.cc:5:126: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
bug_5.cc:5:126: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
bug_5.cc:5:126: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
bug_5.cc:5:126: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
bug_5.cc:5:126: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: expected '>'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:128: note: to match this '<'
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
bug_5.cc:5:134: error: type name requires a specifier or qualifier
5 | B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<A<B<> b;
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWk1v4zYQ_TX0ZWBDIiVLOvjgjwTdQ9FL0euCFscSW4rU8iOOL_ntBSUnhpMsFttdoA5WQpDRBzkcPr73fBnunGw04orkG5LvZjz41tiV5B3XRp86E1ztZnsjTitCGWxN13EtSLIjyZosk1px3cA-NJ_zRV2TZXL-MgwVOD792SLUpuul4l4aDb01NToHLdeNA6kFHqSWHtUJjtK3Jvg4RIRa6ga4PoEJvg-e0C1wLeATaONljQI41EZ7qYMJMU9tkTsEqaHDzthT_OpC18dFFzBWIRCcln2PHnzLPXgrmwatA99KF5fdK-xAO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