File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
libcxx/test/libcxx/utilities/smartptr Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 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+
1717void 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}
You can’t perform that action at this time.
0 commit comments