Skip to content

Commit aec1cce

Browse files
committed
fixing tests
1 parent b831af3 commit aec1cce

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

libcxx/test/libcxx/utilities/expected/expected.expected/and_then.mandates.verify.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ void test() {
128128
{
129129
const std::expected<int, int> f1(std::unexpected<int>(1));
130130

131-
// expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
132-
f1.and_then([](int&){ return 1; });
131+
f1.and_then([](int& _){ return 1; }); // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
133132
}
134133
}
135134
// clang-format on

libcxx/test/libcxx/utilities/expected/expected.void/and_then.mandates.verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void test() {
127127
{
128128
const std::expected<int, int> f1(std::unexpected<int>(1));
129129

130-
f1.and_then([](int&){ return 1; }); // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
130+
f1.and_then([](int& _){ return 1; }); // expected-warning@+1 {{ignoring return value of function declared with 'nodiscard' attribute}}
131131
}
132132
}
133133
// clang-format on

libcxx/test/libcxx/utilities/expected/expected.void/or_else.mandates.verify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ void test() {
8989
{
9090
std::expected<void, int> f1(std::unexpected<int>(1));
9191
std::ignore = std::move(f1).or_else(rval_return_not_std_expected); // expected-note{{in instantiation of function template specialization 'std::expected<void, int>::or_else<int (&)(int &&)>' requested here}}
92-
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f((void)std::move(error())) must be a specialization of std::expected}}
92+
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f(std::move(error())) must be a specialization of std::expected}}
9393
// expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it has no members}}
9494
}
9595

9696
// !std::is_same_v<G:value_type, T>
9797
{
9898
std::expected<void, int> f1(std::unexpected<int>(1));
9999
std::ignore = std::move(f1).or_else(rval_error_type_not_same_as_int); // expected-note{{in instantiation of function template specialization 'std::expected<void, int>::or_else<std::expected<NotSameAsInt, int> (&)(int &&)>' requested here}}
100-
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f((void)std::move(error())) must have the same value_type as this expected}}
100+
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f(std::move(error())) must have the same value_type as this expected}}
101101
}
102102
}
103103

@@ -107,15 +107,15 @@ void test() {
107107
{
108108
const std::expected<void, int> f1(std::unexpected<int>(1));
109109
std::ignore = std::move(f1).or_else(crval_return_not_std_expected); // expected-note{{in instantiation of function template specialization 'std::expected<void, int>::or_else<int (&)(const int &&)>' requested here}}
110-
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f((void)std::move(error())) must be a specialization of std::expected}}
110+
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f(std::move(error())) must be a specialization of std::expected}}
111111
// expected-error-re@*:* {{{{.*}}cannot be used prior to '::' because it has no members}}
112112
}
113113

114114
// !std::is_same_v<G:value_type, T>
115115
{
116116
const std::expected<void, int> f1(std::unexpected<int>(1));
117117
std::ignore = std::move(f1).or_else(crval_error_type_not_same_as_int); // expected-note{{in instantiation of function template specialization 'std::expected<void, int>::or_else<std::expected<NotSameAsInt, int> (&)(const int &&)>' requested here}}
118-
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f((void)std::move(error())) must have the same value_type as this expected}}
118+
// expected-error-re@*:* {{static assertion failed {{.*}}The result of f(std::move(error())) must have the same value_type as this expected}}
119119
}
120120
}
121121

0 commit comments

Comments
 (0)