[libcxx-commits] [libcxx] b48a256 - [libcxx] [test] Don't look for the literal spelling __mbstate_t in warnings

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 31 12:13:46 PDT 2021


Author: Martin Storsjö
Date: 2021-05-31T22:13:21+03:00
New Revision: b48a256e9c6e300f9f3f20180db369b9e7e27250

URL: https://github.com/llvm/llvm-project/commit/b48a256e9c6e300f9f3f20180db369b9e7e27250
DIFF: https://github.com/llvm/llvm-project/commit/b48a256e9c6e300f9f3f20180db369b9e7e27250.diff

LOG: [libcxx] [test] Don't look for the literal spelling __mbstate_t in warnings

While the code uses the type name `std::mbstate_t`, the warning message
mentions the original underlying type, which is a C library internal
type name.

On Windows this type is called `_Mbstatet` instead of `__mbstate_t`. Use
expect-warning-re to avoid spelling out the literal name of the type.

Due to issues with the detection of the clang-verify feature, these
tests have been skipped in the Windows CI configuration so far.

Differential Revision: https://reviews.llvm.org/D103309

Added: 
    

Modified: 
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
    libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
index bdf8b6060dc3d..c430321699a6d 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char16_t_char.depr_in_cxx20.verify.cpp
@@ -20,7 +20,9 @@
 
 int main(int, char **)
 {
-    with_public_dtor<std::codecvt_byname<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning {{'codecvt_byname<char16_t, char, __mbstate_t>' is deprecated}}
+    // Don't test for the exact type since the underlying type of
+    // std::mbstate_t depends on implementation details.
+    with_public_dtor<std::codecvt_byname<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char16_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
 
     return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
index 1efab596499eb..ebace3a4f647f 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt.byname/codecvt_byname_char32_t_char.depr_in_cxx20.verify.cpp
@@ -20,7 +20,9 @@
 
 int main(int, char **)
 {
-    with_public_dtor<std::codecvt_byname<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning {{'codecvt_byname<char32_t, char, __mbstate_t>' is deprecated}}
+    // Don't test for the exact type since the underlying type of
+    // std::mbstate_t depends on implementation details.
+    with_public_dtor<std::codecvt_byname<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt_byname<char32_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
 
     return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
index 289d9e5f45607..54f57c6b04985 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char16_t_char.depr_in_cxx20.verify.cpp
@@ -20,7 +20,9 @@
 
 int main(int, char **)
 {
-    with_public_dtor<std::codecvt<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning {{'codecvt<char16_t, char, __mbstate_t>' is deprecated}}
+    // Don't test for the exact type since the underlying type of
+    // std::mbstate_t depends on implementation details.
+    with_public_dtor<std::codecvt<char16_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char16_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
 
     return 0;

diff  --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
index d415d919e543e..9b7fdc5165b67 100644
--- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.codecvt/codecvt_char32_t_char.depr_in_cxx20.verify.cpp
@@ -20,7 +20,9 @@
 
 int main(int, char **)
 {
-    with_public_dtor<std::codecvt<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning {{'codecvt<char32_t, char, __mbstate_t>' is deprecated}}
+    // Don't test for the exact type since the underlying type of
+    // std::mbstate_t depends on implementation details.
+    with_public_dtor<std::codecvt<char32_t, char, std::mbstate_t>> cvt("", 0); // expected-warning-re {{'codecvt<char32_t, char, {{.*}}>' is deprecated}}
     (void)cvt;
 
     return 0;


        


More information about the libcxx-commits mailing list