[libcxx-commits] [libcxx] [libc++] Complete overload removal in P3016R6 (PR #216932)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 19 12:00:19 PDT 2026


================
@@ -76,14 +79,20 @@ int main(int, char**)
     test_const_container ( a );
     test_const_container ( il );
 
-#if TEST_STD_VER > 14
     std::string_view sv{"ABC"};
-    test_container ( sv );
-    test_const_container ( sv );
-#endif
+    test_container(sv);
+    test_const_container(sv);
 
     static constexpr int arrA [] { 1, 2, 3 };
     test_const_array ( arrA );
 
+    {
+      // Verify that the std::empty overload for std::initializer_list is absent (removed by P3016R6).
+      // The behavior of std::empty({vals...}) is unchanged because the overload for const T(&)[N] is used.
+      using p3016r6::empty;
+      using std::empty;
+      static_assert(std::is_same_v<decltype(empty({1, 2, 3})), void>);
+    }
----------------
philnik777 wrote:

Yeah, I guess it wouldn't be easy to diagnose and isn't actively harmful.

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


More information about the libcxx-commits mailing list