Skip to content

Commit 23356ef

Browse files
committed
using int instead of S for make_unique/make_shared nodiscard test
1 parent d6ac2b2 commit 23356ef

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

libcxx/test/libcxx/memory/nodiscard.verify.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,13 @@
2323

2424
void f() {
2525

26-
struct S {
27-
S() = default;
28-
};
26+
std::make_unique<int>(1); // expected-warning {{ignoring return value of function}}
27+
std::make_shared<int>(1); // expected-warning {{ignoring return value of function}}
2928

30-
std::make_unique<S>(S{}); // expected-warning {{ignoring return value of function}}
31-
std::make_shared<S>(S{}); // expected-warning {{ignoring return value of function}}
29+
std::make_unique<int[]>(5); // expected-warning {{ignoring return value of function}}
30+
std::make_shared<int[]>(5); // expected-warning {{ignoring return value of function}}
3231

33-
std::make_unique<S[]>(5); // expected-warning {{ignoring return value of function}}
34-
std::make_shared<S[]>(5); // expected-warning {{ignoring return value of function}}
35-
36-
std::make_unique_for_overwrite<S>(); // expected-warning {{ignoring return value of function}}
37-
std::make_shared_for_overwrite<S>(); // expected-warning {{ignoring return value of function}}
32+
std::make_unique_for_overwrite<int>(); // expected-warning {{ignoring return value of function}}
33+
std::make_shared_for_overwrite<int>(); // expected-warning {{ignoring return value of function}}
3834

3935
}

0 commit comments

Comments
 (0)