| Issue |
83658
|
| Summary |
Type definitions should be allowed inside of the offsetof type
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
Halalaluyafail3
|
Clang does not accept type definitions inside of the type provided to offsetof. However, I don't see any wording which forbids this. Here is an example program (Clang 16 and newer don't seem to accept this):
```c
#include<stddef.h>
int main(void){
offsetof(struct{int a;},a);
}
```
There was a proposal (N2350) which added some text to make this UB, but that has been changed since by DE-137 (N3148) which removes this restriction and only makes it UB if there is an unparenthesized comma inside of offsetof. N3167 includes discussion about accepting DE-137.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs