[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages
authorMalavikaSamak <malavika2@apple.com>
Wed, 19 Apr 2023 22:52:12 +0000 (15:52 -0700)
committerMalavikaSamak <malavika2@apple.com>
Wed, 19 Apr 2023 22:53:21 +0000 (15:53 -0700)
commit777eb4bcfc3265359edb7c979d3e5ac699ad4641
tree1aec6bacc97363bba55e2fa8dfa53bb345f03eb1
parent376402bef1380fb65b4b78d69f82a57130df583e
[-Wunsafe-buffer-usage] Handle unevaluated contexts that contain unsafe buffer usages

This patch handles unevaluated contexts to ensure no warnings are produced by the machinery
for buffer access made within an unevaluated contexts. However, such accesses must be
considered by a FixableGadget and produce the necessary fixits.

Reviewed by: NoQ, ziqingluo-90, jkorous

Differential revision: https://reviews.llvm.org/D144905
clang/lib/Analysis/UnsafeBufferUsage.cpp
clang/test/SemaCXX/warn-unsafe-buffer-usage-fixits-unevaluated-context.cpp [new file with mode: 0644]
clang/test/SemaCXX/warn-unsafe-buffer-usage-warning-unevaluated-context.cpp [new file with mode: 0644]
clang/test/SemaCXX/warn-unsafe-buffer-usage.cpp