This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 120a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2026-06-11


3199. Missing predefined macros for chart16_t and char32_t

Section: 15.12  [cpp.predefined]     Status: open     Submitter: Jason Merrill     Date: 2013-01-29

(Originally submitted as LWG issue 2237.)

The macros __STDC_UTF_16__ and __STDC_UTF_32__ are predefined by the C implementation. C++ is missing them.

Possible resolution:

Change in 15.12 [cpp.predefined] paragraph 1 as follows:

...
__STDC_HOSTED__
The integer literal 1 if the implementation is a hosted implementation or the integer literal 0 if it is a freestanding implementation (4.1 [intro.compliance]).
__STDC_UTF_16__
The integer literal 1, intended to indicate that values of type char16_t are UTF-16 encoded (5.13.3 [lex.ccon], 5.13.5 [lex.string]).
__STDC_UTF_32__
The integer literal 1, intended to indicate that values of type char32_t are UTF-32 encoded (5.13.3 [lex.ccon], 5.13.5 [lex.string]).