[clang-tools-extra] [clang-tidy] Warn on use of std::get_temporary_buffer (PR #176191)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 16 05:49:14 PST 2026
NagyDonat wrote:
> Putting this function in `bugprone-unsafe-functions` feels like a bit of stretch (it wasn't deprecated for being unsafe, just for being useless), but I'm alright with it.
I agree that it is a bit of stretch, but I don't know a better place for handling this function.
By the way, this function *is* unsafe, it returns uninitialized memory which can break "common sense" things (e.g. it is invalid to use `operator=` on the uninitialized elements of this buffer) and cause subtle bugs. The fact that it is useless made the deprecation a trivial decision, but IMHO it would deserve to be on this list even if it wasn't useless.
https://github.com/llvm/llvm-project/pull/176191
More information about the cfe-commits
mailing list