[Clang] `gnu::aligned` attribute inconsistently removed during type un-qualification
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
https://godbolt.org/z/a1zjYMrY5
```c
[[gnu::aligned]] typedef int T1;
[[gnu::aligned]] typedef int const T2;
[[gnu::aligned]] typedef int volatile T3;
__typeof_unqual(T1) i1; // 16-bytes aligned
__typeof_unqual(T2) i2; // 4-bytes aligned
__typeof_unqual(T3) i3; // 4-bytes aligned
```
IMO this is rather inconsistent, however GCC also behaves like this.
Contributor guide
Research direction
Start with the linked Godbolt reproducer and compare Clang's handling of __typeof_unqual for T1, T2, and T3, including the resulting alignment. The issue does not name a source file or test, and it leaves the intended consistent behavior unresolved; done would require an agreed behavior plus coverage demonstrating it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100