<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71203>71203</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][AST] `NULL` node for function template body with `-target x86_64-pc-win32` pre c++20
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
5chmidti
</td>
</tr>
</table>
<pre>
This bug was found during #70559.
Repro case:
```c++
template <typename T>
void f() {}
```
Clang creates valid ASTs for this snippet with:
- `-target x86_64-pc-win32 -std=c++20`
- `-std=c++17` (linux)
- `-std=c++20` (linux)
But not with:
- `-target x86_64-pc-win32 -std=c++17`
- `-target x86_64-pc-win32 -std=c++14`
- `-target x86_64-pc-win32 -std=c++11`
https://godbolt.org/z/9v98vnbsx
```
TranslationUnitDecl
`-FunctionTemplateDecl <line:1:1, line:2:11> col:6 f
|-TemplateTypeParmDecl <line:1:11, col:20> col:20 typename depth 0 index 0 T
`-FunctionDecl <line:2:1, col:11> col:6 f 'void ()'
`-CompoundStmt <col:10, col:11>
```
vs
```
TranslationUnitDecl
`-FunctionTemplateDecl <line:1:1, line:2:8> col:6 f
|-TemplateTypeParmDecl <line:1:11, col:20> col:20 typename depth 0 index 0 T
`-FunctionDecl <line:2:1, col:8> col:6 f 'void ()'
`-<<<NULL>>>
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUlUGPozYUxz_N4_JEZGzAcOAwSZbTqqo67Lky2AFXxiBsMjP99JUhk9lNt5V2D5UqOY6M_X7838vzP8I53VulKsiOkJ0jsfphWqqsG0YtvY7aSb5VzaAdtmuPL8LhZVqtRLku2vYIlHGSZeUByBnI0z7_puZlwk44Bez2CHKyjw7oMYztqVfjbIRXCOzk32ZlxaiwAfZp375OWuIFaAG0ROBH4OcH2r48GWF77BYlvHJ4FUZLfHpugtQFfdDurJ5n5fFF--GuKUbISezF0iuPr0X-e57Gcxe_aMsoxs5LYOebXPrxsj3qm92EQ04QaGG0XV-Blv94cuP8_eQ-H1ePdvp5kZuMH49KfyoquUft8-D97IJqWgOt-0m2k_GHaemB1n8CrctrWVxt616_Dnr4HZtFWGeE15P9YrU_q87cz8X1aruw09x6JuyGvjHahjZLtg894W1NwzoB9gm7yQB7yvGysxCBn-J3SvM2q1_FMn6PtuH2aEo-SJTgvVelmv2ABLWV6hUJNvd3fKX4gU3fle64B5EIlG99v7c9UP6O3KGnaZzDBXz2ow_QG4Q8AL9b36v7T8pe_A-qXvxQ0YGd9vHLl8-fQ3X38W0xI1kxWbJSRKpK8rIkjBRZFg1VJxUr2zwVvLiUMhUX3qa8yC6JzIq0zXmkK0ooSxLCEk5Ilh2SspNMEMI5L0nKFKREjUKbgzHXMVyqSDu3qoonlLDIiFYZtxk4pV3wQqA0ePlShfNxu_YOUmK08-6D4LU3m-vvEdkZsuPTcwPZOaS8JZoTtJNUm41ebmXFu2eHf4bNq_7FNQJiXhTe7S9aF1M9eIX2w9oeumkEWgd5t694XqY_VOeB1lu2Dmi9JfxXAAAA__-U8OG4">