[libcxx-commits] [libcxx] [libc++] Diagnose unused variables of container types (PR #203084)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 18 00:52:30 PDT 2026


================
@@ -84,7 +84,7 @@ _LIBCPP_PUSH_MACROS
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Allocator /* = allocator<_Tp> */>
-class vector {
+class [[__gnu__::__warn_unused__]] vector {
----------------
philnik777 wrote:

True, but I kinda doubt this is in any way common. If we find it is we can revise later.

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


More information about the libcxx-commits mailing list