[C2x] reject type definitions in offsetof
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2350.htm made very clear that it is an UB having type definitions with in offsetof. After this patch clang will reject any type definitions in __builtin_offsetof. Fixes https://github.com/llvm/llvm-project/issues/57065 ``` local/offsetof.c:10:38: error: 'struct S' cannot be defined in '__builtin_offsetof' return __builtin_offsetof(struct S{ int a, b;}, a); ^ ``` Reviewed By: aaron.ballman, #clang-language-wg Differential Revision: https://reviews.llvm.org/D133574
Loading
Please sign in to comment