Skip to content

Commit dce3ae8

Browse files
committed
Revert changes to expected-errors
1 parent 56d82c4 commit dce3ae8

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +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{{.*}}}}
58+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
5959
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
6060
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
6161

6262
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{{.*}}}}
63+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
6464
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
6565
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
6666
}
@@ -69,26 +69,27 @@ void test() {
6969
{
7070
const std::expected<int, int> e;
7171
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{{.*}}}}
72+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
7373
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{{.*}}}}
74+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
7575
}
7676

7777
// Test && overload
7878
{
7979
std::expected<int, int> e;
8080
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{{.*}}}}
81+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
8282
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{{.*}}}}
83+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
8484
}
8585

8686
// Test const&& overload
8787
{
8888
const std::expected<int, int> e;
8989
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{{.*}}}}
90+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
9191
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}}
92+
// expected-error-re@*:* 0-2 {{no matching constructor for initialization of{{.*}}}}
9293
}
9394
}
9495
// clang-format on

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +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{{.*}}}}
59+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
6060
// 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}}
6161
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
6262
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
6363

6464
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{{.*}}}}
65+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
6666
// 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}}
6767
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
6868
}
@@ -71,24 +71,28 @@ void test() {
7171
{
7272
const std::expected<void, int> e;
7373
e.transform_error(return_unexpected<const int &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
74+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
7475
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}}
76+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
7577
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
7678
}
7779

7880
// Test && overload
7981
{
8082
std::expected<void, int> e;
8183
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}}
84+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
8285
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{{.*}}}}
86+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
8487
}
8588

8689
// Test const&& overload
8790
{
8891
const std::expected<void, int> e;
8992
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}}
93+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
9094
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{{.*}}}}
95+
// expected-error-re@*:* 0-1 {{no matching constructor for initialization of{{.*}}}}
9296
}
9397
}
9498
// clang-format on

0 commit comments

Comments
 (0)