Title
Missing predefined macros for chart16_t and char32_t
Status
open
Section
15.12 [cpp.predefined]
Submitter
Jason Merrill

Created on 2013-01-29.00:00:00 last changed 1 week ago

Messages

Date: 2026-06-11.21:47:15

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]).
Date: 2013-01-29.00:00:00

(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.

History
Date User Action Args
2026-06-11 21:47:15adminsetmessages: + msg8602
2013-01-29 00:00:00admincreate