[clang-tools-extra] [clang-tidy] Warn on use of std::get_temporary_buffer (PR #176191)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 19 03:21:25 PST 2026


=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>,
=?utf-8?q?Donát?= Nagy <donat.nagy at ericsson.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/176191 at github.com>


================
@@ -97,6 +98,9 @@ static StringRef getRationaleFor(StringRef FunctionName) {
       .Cases({"rewind", "setbuf"}, "has no error detection")
       .Case("vfork", "is insecure as it can lead to denial of service "
                      "situations in the parent process")
+      .Case("get_temporary_buffer",
+            "is bugprone, has no performance advantage, was deprecated in "
+            "C++17 and removed in C++20")
----------------
vbvictor wrote:

Instead of "is bugprone" can we give clearer rationale like "returns uninitialized memory without performance advantages, was ..." which you said in PR description.

https://github.com/llvm/llvm-project/pull/176191


More information about the cfe-commits mailing list