| Issue |
162126
|
| Summary |
[AST Print] Attribute `asm` is dumped in the incorrect location
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
giulianobelinassi
|
With the following input saved as `test.c` (input code from glibc):
```
extern const char _libc_intl_domainname[];
extern typeof (_libc_intl_domainname) _libc_intl_domainname asm("__GI__libc_intl_domainname") __attribute__((visibility("hidden")));
```
This input is successfully accepted by clang, as it shows no output:
```
$ clang -S test.c
```
However, dumping the AST:
```
$ clang -Xclang -ast-print -S test.c -o test.print.c
```
dumps an output that is not accepted by clang:
```
clang -S test.print.c
test.print.c:2:98: error: expected ';' after top level declarator
2 | extern typeof (_libc_intl_domainname) _libc_intl_domainname __attribute__((visibility("hidden"))) asm("__GI__libc_intl_domainname");
| ^
| ;
1 error generated.
```
Output of clang --version:
```
$ clang --version
clang version 21.1.1
Target: x86_64-suse-linux
Thread model: posix
InstalledDir: /usr/bin
```
Related PRs: [87281](https://github.com/llvm/llvm-project/pull/87281), https://github.com/llvm/llvm-project/pull/88600
Requesting comments from @vgvassilev
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs