Skip to content

Commit 311d104

Browse files
committed
Moved nodiscard tests
1 parent 860b731 commit 311d104

File tree

4 files changed

+10
-44
lines changed

4 files changed

+10
-44
lines changed

libcxx/test/libcxx/diagnostics/string.nodiscard.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212

1313
#include <string>
1414

15+
#include "test_macros.h"
16+
1517
void test() {
1618
std::string string;
1719
string.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
20+
#if TEST_STD_VER >= 26
21+
string.subview(); // expected-warning {{ignoring return value of function}}
22+
#endif
1823
}

libcxx/test/libcxx/diagnostics/string_view.nodiscard.verify.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212

1313
#include <string_view>
1414

15+
#include "test_macros.h"
16+
1517
void test() {
1618
std::string_view string_view;
1719
string_view.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
20+
#if TEST_STD_VER >= 26
21+
string_view.subview(); // expected-warning {{ignoring return value of function}}
22+
#endif
1823
}

libcxx/test/std/strings/basic.string/string.ops/string_substr/nodiscard.verify.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

libcxx/test/std/strings/string.view/string.view.ops/nodiscard.verify.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)