Skip to content

Commit 8962d8b

Browse files
committed
Addressed review comment
1 parent ec331c6 commit 8962d8b

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,11 @@ void test_members() {
121121
#endif
122122
}
123123

124-
class TestHash {
125-
public:
126-
template <typename CharT>
127-
void operator()() {
128-
using StringViewT = std::basic_string_view<CharT>;
129-
std::hash<StringViewT> hash;
130-
// expected-warning@+1 4-5 {{ignoring return value of function declared with 'nodiscard' attribute}}
131-
hash(StringViewT{});
132-
}
133-
};
134-
135124
void test_nonmembers() {
136125
// std::hash<>
137-
types::for_each(types::character_types(), TestHash{});
126+
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
127+
std::hash<std::string_view> hash;
128+
hash();
138129

139130
#if TEST_STD_VER >= 14
140131
// string_view literals

0 commit comments

Comments
 (0)