You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -55,10 +55,12 @@ void test() {
55
55
{
56
56
std::expected<int, int> e;
57
57
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
59
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
59
60
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
60
61
61
62
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{{.*}}}}
62
64
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
63
65
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
64
66
}
@@ -67,20 +69,25 @@ void test() {
67
69
{
68
70
const std::expected<int, int> e;
69
71
e.transform_error(return_unexpected<constint &>); // 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{{.*}}}}
70
73
e.transform_error(return_no_object<constint &>); // 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{{.*}}}}
71
75
}
72
76
73
77
// Test && overload
74
78
{
75
79
std::expected<int, int> e;
76
80
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{{.*}}}}
77
82
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{{.*}}}}
78
84
}
79
85
80
86
// Test const&& overload
81
87
{
82
88
const std::expected<int, int> e;
83
89
std::move(e).transform_error(return_unexpected<constint&&>); // 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{{.*}}}}
84
91
std::move(e).transform_error(return_no_object<constint&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
Copy file name to clipboardExpand all lines: libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -56,11 +56,13 @@ void test() {
56
56
{
57
57
std::expected<void, int> e;
58
58
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
60
// 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}}
60
61
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
61
62
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
62
63
63
64
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{{.*}}}}
64
66
// 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}}
65
67
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
66
68
}
@@ -78,13 +80,15 @@ void test() {
78
80
std::expected<void, int> e;
79
81
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}}
80
82
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{{.*}}}}
81
84
}
82
85
83
86
// Test const&& overload
84
87
{
85
88
const std::expected<void, int> e;
86
89
std::move(e).transform_error(return_unexpected<constint&&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
87
90
std::move(e).transform_error(return_no_object<constint&&>); // 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{{.*}}}}
0 commit comments