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
[libc++] Fix transform_error.mandates.verify.cpp test on msvc (#104635)
PR #102851 marks reference types in union as error on msvc by changing
the clang, which makes 'transform_error.mandates.verify.cpp' no longer
failing on msvc from ToT. However, all libcxx buildbots do not build
clang from source, therefore, this test will still fail on these bots,
which is incorrect. This patch changed the expected error message of
this test so it can pass with both release branch clang and ToT clang.
Copy file name to clipboardExpand all lines: libcxx/test/libcxx/utilities/expected/expected.expected/transform_error.mandates.verify.cpp
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,13 @@
13
13
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
14
14
15
15
// With clang-cl, some warnings have a 'which is a Microsoft extension' suffix
16
-
// which break the tests.
17
-
// XFAIL: msvc
16
+
// which break the tests. But #102851 will turn it into an error, making the test pass.
17
+
// However, upstream libcxx buildbots do not build clang from source while testing, so
18
+
// this tests still expected to fail on these bots.
19
+
//
20
+
// TODO(LLVM 22): Remove '0-1' from 'expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}'
21
+
// and remove 'expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}'
22
+
// once LLVM 22 releases. See https://github.com/llvm/llvm-project/issues/104885.
18
23
19
24
// Test the mandates
20
25
@@ -56,11 +61,12 @@ void test() {
56
61
e.transform_error(return_unexpected<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
57
62
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
58
63
// 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
-
// expected-error-re@*:* {{union member {{.*}} has reference type {{.*}}}}
64
+
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
60
65
61
66
e.transform_error(return_no_object<int&>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
62
67
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
63
68
// expected-error-re@*:* {{static assertion failed {{.*}}[expected.object.general] A program that instantiates the definition of template expected<T, E> for {{.*}} is ill-formed.}}
69
+
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
Copy file name to clipboardExpand all lines: libcxx/test/libcxx/utilities/expected/expected.void/transform_error.mandates.verify.cpp
+11-3Lines changed: 11 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,14 @@
13
13
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
14
14
15
15
// With clang-cl, some warnings have a 'which is a Microsoft extension' suffix
16
-
// which break the tests.
17
-
// XFAIL: msvc
16
+
// which break the tests. But #102851 will turn it into an error, making the test pass.
17
+
// However, upstream libcxx buildbots do not build clang from source while testing, so
18
+
// this tests still expected to fail on these bots.
19
+
//
20
+
// TODO(LLVM 22): Remove '0-1' from 'expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}'
21
+
// and remove 'expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}'
22
+
// and remove 'expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}'
23
+
// once LLVM 22 releases. See See https://github.com/llvm/llvm-project/issues/104885.
18
24
19
25
// Test the mandates
20
26
@@ -57,11 +63,12 @@ void test() {
57
63
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
58
64
// 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}}
59
65
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
60
-
// expected-error-re@*:* {{union member {{.*}} has reference type {{.*}}}}
66
+
// expected-error-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}}}
61
67
62
68
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
69
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
64
70
// 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}}
71
+
// expected-warning-re@*:* 0-1 {{union member {{.*}} has reference type {{.*}}, which is a Microsoft extension}}
65
72
}
66
73
67
74
// Test const& overload
@@ -71,6 +78,7 @@ void test() {
71
78
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
72
79
e.transform_error(return_no_object<constint &>); // expected-error-re@*:* {{static assertion failed {{.*}}The result of {{.*}} must be a valid template argument for unexpected}}
73
80
// expected-error-re@*:* 0-1 {{{{(excess elements in struct initializer|no matching constructor for initialization of)}}{{.*}}}}
81
+
// expected-error-re@*:* 0-1 {{call to deleted constructor of {{.*}}}}
0 commit comments