[libcxx-commits] [libcxx] [libc++][string] P3044R2: sub-`string_view` from `string` (PR #147095)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Mon Sep 22 00:09:40 PDT 2025


================
@@ -12,7 +12,12 @@
 
 #include <string>
 
+#include "test_macros.h"
+
 void test() {
   std::string string;
   string.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
+#if TEST_STD_VER >= 26
+  string.subview(); // expected-warning {{ignoring return value of function}}
----------------
philnik777 wrote:

Should we match the diagnostic tested here with the above?

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


More information about the libcxx-commits mailing list