Commit 63413015 authored by ziqingluo-90's avatar ziqingluo-90
Browse files

[-Wunsafe-buffer-usage] Improve fix-its for local variable declarations with...

[-Wunsafe-buffer-usage] Improve fix-its for local variable declarations with null pointer initializers

For a local pointer declaration of the form `T * p = 0` or `T * p = std::nullptr`,

Before this patch, we generate fix-its that convert the declaration to
`std::span<T> p{nullptr, <# placeholder #>}`, in cases where `p` is
used in some unsafe operations.  This patch improves the fix-its to
result in a simpler form `std::span<T> p`. It gets rid of the
placeholder and keeps the result concise.

Reviewed by: NoQ (Artem Dergachev)

Differential Revision: https://reviews.llvm.org/D143680
parent 5e57f1bf
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment