Skip to content

Commit 85a4278

Browse files
committed
Try fixing verify test
1 parent 66c1a8e commit 85a4278

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ void test() {
5555
{
5656
std::expected<int, int> e;
5757
e.transform_error(return_unexpected<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
58+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
5859
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
5960
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
6061

6162
e.transform_error(return_no_object<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
63+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
6264
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
6365
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
6466
}
@@ -67,20 +69,25 @@ void test() {
6769
{
6870
const std::expected<int, int> e;
6971
e.transform_error(return_unexpected<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
72+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
7073
e.transform_error(return_no_object<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
74+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
7175
}
7276

7377
// Test && overload
7478
{
7579
std::expected<int, int> e;
7680
std::move(e).transform_error(return_unexpected<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
81+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
7782
std::move(e).transform_error(return_no_object<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
83+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
7884
}
7985

8086
// Test const&& overload
8187
{
8288
const std::expected<int, int> e;
8389
std::move(e).transform_error(return_unexpected<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
90+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
8491
std::move(e).transform_error(return_no_object<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
8592
}
8693
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ void test() {
5656
{
5757
std::expected<void, int> e;
5858
e.transform_error(return_unexpected<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
59+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
5960
// expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected<T, E> with a E that is not a valid argument for unexpected<E> is ill-formed}}
6061
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
6162
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
6263

6364
e.transform_error(return_no_object<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
65+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
6466
// expected-error-re@*:* {{static assertion failed {{.*}}A program that instantiates expected<T, E> with a E that is not a valid argument for unexpected<E> is ill-formed}}
6567
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
6668
}
@@ -78,13 +80,15 @@ void test() {
7880
std::expected<void, int> e;
7981
std::move(e).transform_error(return_unexpected<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
8082
std::move(e).transform_error(return_no_object<int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
83+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
8184
}
8285

8386
// Test const&& overload
8487
{
8588
const std::expected<void, int> e;
8689
std::move(e).transform_error(return_unexpected<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
8790
std::move(e).transform_error(return_no_object<const int&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
91+
// expected-error-re@*:* 1 {{no matching constructor for initialization of{{.*}}}}
8892
}
8993
}
9094
// clang-format on

0 commit comments

Comments
 (0)