diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2023-01-17 14:26:29 -0500 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2023-01-17 14:30:57 -0500 |
commit | f1f0a0d8e8fdd2e534d9423b2e64c6b8aaa53aee (patch) | |
tree | bfd158a73917a5baa36d973aeb1ad13595cbc9ca /llvm/unittests/ADT/ArrayRefTest.cpp | |
parent | 09e4449901d7fc780806778181cf3136c1e08e98 (diff) | |
download | llvm-f1f0a0d8e8fdd2e534d9423b2e64c6b8aaa53aee.zip llvm-f1f0a0d8e8fdd2e534d9423b2e64c6b8aaa53aee.tar.gz llvm-f1f0a0d8e8fdd2e534d9423b2e64c6b8aaa53aee.tar.bz2 |
Diagnose extensions 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.
Clang supports defining a type as the first argument as a conforming
extension due to how many projects use the construct in C99 and earlier
to calculate the alignment of a type. GCC also supports defining a type
as the first argument.
This adds extension warnings and documentation for the functionality
Clang explicitly supports.
Fixes #57065
Co-authored-by: Yingchi Long <i@lyc.dev>
Co-authored-by: Aaron Ballman <aaron@aaronballman.com>
Diffstat (limited to 'llvm/unittests/ADT/ArrayRefTest.cpp')
0 files changed, 0 insertions, 0 deletions