swiftlang / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Swift’s stable releases of Clang as well as support the Swift project.
https://llvm.org
Other
1.12k stars 331 forks source link

[attributes][-Wunsafe-buffer-usage] Support adding unsafe_buffer_usage attribute to struct fields (#101585) #9126

Closed malavikasamak closed 2 months ago

malavikasamak commented 2 months ago

Extend the unsafe_buffer_usage attribute, so they can also be added to struct fields. This will cause the compiler to warn about the unsafe field at their access sites.

Co-authored-by: MalavikaSamak malavika2@apple.com (cherry picked from commit 6b652f6edaa84a9e4934885f6f12b973efb1b810)