[all-commits] [llvm/llvm-project] f16204: [libc++][test] Make narrowing in `nasty_char_trait...

A. Jiang via All-commits all-commits at lists.llvm.org
Wed Jun 3 01:31:12 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f1620435a384c56e718a80ca0b2695285b6ce978
      https://github.com/llvm/llvm-project/commit/f1620435a384c56e718a80ca0b2695285b6ce978
  Author: A. Jiang <de34 at live.cn>
  Date:   2026-06-03 (Wed, 03 Jun 2026)

  Changed paths:
    M libcxx/test/support/nasty_string.h

  Log Message:
  -----------
  [libc++][test] Make narrowing in `nasty_char_traits::to_char_type` more explicit (#138375)

Previously, the cast was allowed due to
[P0960R3](https://wg21.link/p0960r3), which made narrowing implicitly
done in the parenthesized aggregate initialization. MSVC doesn't seem
happy with such an implicit manner, despite not being
copy-initialization or list-initialization, and emits warning C4242.

This patch makes the narrowing more explicit to MSVC with `static_cast`.
Follows up 3e7be494f84e51d5f4245d6f39e380a500f226a6.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list