[-Wunsafe-buffer-usage] Use relevant source locations for warnings
authorJan Korous <jkorous@apple.com>
Tue, 10 Jan 2023 01:36:48 +0000 (17:36 -0800)
committerJan Korous <jkorous@apple.com>
Wed, 18 Jan 2023 22:18:54 +0000 (14:18 -0800)
commit39a63fc7fe9824313764a9da8565a705d3024b1a
tree581676edf453709e2a97774958af8644e513457f
parent304d7307aee15b6eb88d198ae94b595f4e09f485
[-Wunsafe-buffer-usage] Use relevant source locations for warnings

This way we highlight a particular unsafe subexpression by providing more accurate
source location than begin of an entire statement.

Differential Revision: https://reviews.llvm.org/D141340
clang/lib/Sema/AnalysisBasedWarnings.cpp
clang/test/SemaCXX/warn-unsafe-buffer-usage-source-ranges.cpp [new file with mode: 0644]