commit | ab60910e01eaa8bcf993cdb59a95f882b3859fd1 | [log] [tgz] |
---|---|---|
author | A. Jiang <de34@live.cn> | Tue May 13 04:49:25 2025 +0800 |
committer | GitHub <noreply@github.com> | Mon May 12 16:49:25 2025 -0400 |
tree | 836029e7523ea2d6d08a67f0e255c00e6990c435 | |
parent | fa985b5f1e3db76e5f52dec41c2100cb354c771a [diff] |
[libc++][format] Discard contents since null-terminator in character arrays in formatting (#116571) Currently, built-in `char`/`wchar_t` arrays are assumed to be null-terminated sequence with the terminator being the last element in formatting. This doesn't conform to [format.arg]/6.9. > otherwise, if `decay_t<TD>` is `char_type*` or `const char_type*`, > initializes value with `static_cast<const char_type*>(v)`; The standard wording specifies that character arrays are decayed to pointers. When the null terminator is not the last element or there's no null terminator (the latter case is UB), libc++ currently produces different results. Also fixes and hardens `formatter<CharT[N], CharT>::format` in `<__format/formatter_string.h>`. These specializations are rarely used. Fixes #115935. Also checks the preconditions in this case, which fixes #116570.
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.