[PATCH] D55777: [libcxx] Portability fix: add missing includes and static_casts.

Andrey Maksimov via Phabricator reviews at reviews.llvm.org
Mon Dec 17 10:42:09 PST 2018


amakc11 created this revision.
Herald added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, arphaman, ldionne.

This patch fixes the following portability issues in the tests.

Issue 1. Some tests use entitites defined in the standard header files, but do not include these headers directly. As a result, these tests do not compile under some conformant implementations.

Issue 2. Types `wctrans_t` and `wctype_t` are required to be scalar (ISO/IEC 9899:1999, section 7.25.1). Type `std::ios_base::fmtflags` is required to be bitmask (see standard requirement <http://eel.is/c++draft/ios.base#1.3>). Neither of these types is required to be integer, and therefore can be implemented, for example, as `enum`. As a result, any assignment of an integer value to variables of these types without an explicit cast does not compile under some conformant implementations.


Repository:
  rCXX libc++

https://reviews.llvm.org/D55777

Files:
  test/std/containers/unord/unord.map/unord.map.cnstr/assign_copy.pass.cpp
  test/std/depr/depr.c.headers/wctype_h.pass.cpp
  test/std/input.output/iostream.format/ext.manip/get_money.pass.cpp
  test/std/input.output/iostream.format/ext.manip/get_time.pass.cpp
  test/std/input.output/iostream.format/ext.manip/put_money.pass.cpp
  test/std/input.output/iostream.format/ext.manip/put_time.pass.cpp
  test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/int.pass.cpp
  test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/short.pass.cpp
  test/std/input.output/iostream.format/std.manip/resetiosflags.pass.cpp
  test/std/input.output/iostream.format/std.manip/setbase.pass.cpp
  test/std/input.output/iostream.format/std.manip/setfill.pass.cpp
  test/std/input.output/iostream.format/std.manip/setiosflags.pass.cpp
  test/std/input.output/iostream.format/std.manip/setprecision.pass.cpp
  test/std/input.output/iostream.format/std.manip/setw.pass.cpp
  test/std/localization/locale.categories/category.ctype/locale.codecvt/locale.codecvt.members/wchar_t_out.pass.cpp
  test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long.pass.cpp
  test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/test_neg_one.pass.cpp
  test/std/strings/c.strings/cwchar.pass.cpp
  test/std/strings/c.strings/cwctype.pass.cpp
  test/std/strings/string.conversions/to_string.pass.cpp
  test/std/strings/string.conversions/to_wstring.pass.cpp
  test/std/utilities/memory/allocator.traits/allocator.traits.members/max_size.pass.cpp
  test/std/utilities/tuple/tuple.tuple/tuple.assign/move.pass.cpp
  test/std/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.pass.cpp
  test/std/utilities/type.index/type.index.hash/hash.pass.cpp
  test/support/poisoned_hash_helper.hpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55777.178491.patch
Type: text/x-patch
Size: 13957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20181217/01f235ae/attachment-0001.bin>


More information about the libcxx-commits mailing list