| Issue |
71203
|
| Summary |
[clang][AST] `NULL` node for function template body with `-target x86_64-pc-win32` pre c++20
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
5chmidti
|
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>>>
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs