[libcxx-commits] [libcxx] [libc++] Fix behavior for `get_temporary_buffer` with non-positive size (PR #206871)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 1 00:37:38 PDT 2026


================
@@ -27,6 +27,11 @@
 #include <memory>
 #include <utility>
 
+#include "test_macros.h"
+
+// This warning is coupled with completeness of control flow analysis which is affected by optimizations.
+TEST_GCC_DIAGNOSTIC_IGNORED("-Wno-alloc-size-larger-than")
----------------
frederick-vs-ja wrote:

> Can we just use `// ADDITIONAL_COMPILE_FLAGS`?

I tried adding `// ADDITIONAL_COMPILE_FLAGS(gcc-style-warnings): -Wno-alloc-size-larger-than`, but that seemed to be wrong, looks like that `// ADDITIONAL_COMPILE_FLAGS(gcc): -Wno-alloc-size-larger-than` should be used.

> Or actually push/pop the diagnostic so it's clear which part of the test is affected.

Thanks! I'll try this approach.

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


More information about the libcxx-commits mailing list