Skip to content

Commit f438302

Browse files
committed
Tweaks
1 parent 0962322 commit f438302

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

libcxx/test/libcxx/utilities/smartptr/nodiscard.verify.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,22 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: std-at-least-c++23
10-
119
// <memory>
1210

1311
// Check that functions are marked [[nodiscard]]
1412

1513
#include <memory>
1614

15+
#include "test_macros.h"
16+
1717
void test() {
18-
std::unique_ptr<int> uPtr;
19-
// [inout.ptr]
20-
std::inout_ptr(uPtr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
21-
// [out.ptr]
22-
std::out_ptr(uPtr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
18+
#if TEST_STD_VER >= 23
19+
{
20+
std::unique_ptr<int> uPtr;
21+
// [inout.ptr]
22+
std::inout_ptr(uPtr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
23+
// [out.ptr]
24+
std::out_ptr(uPtr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
25+
}
26+
#endif
2327
}

0 commit comments

Comments
 (0)