/* CPP Library - charsets
- Copyright (C) 1998-2019 Free Software Foundation, Inc.
+ Copyright (C) 1998-2020 Free Software Foundation, Inc.
Broken out of c-lex.c Apr 2003, adding valid C99 UCN ranges.
If the hexadecimal value is larger than the upper bound of the UCS
codespace specified in ISO/IEC 10646, a pedantic warning is issued
- in all versions of C and in the C++2a or later versions of C++.
+ in all versions of C and in the C++20 or later versions of C++.
*PSTR must be preceded by "\u" or "\U"; it is assumed that the
buffer end is delimited by a non-hex digit. Returns false if the
size_t off, i;
cppchar_t result = 0, c;
+ if (str.len <= nbwc)
+ {
+ /* Error recovery, if no errors have been diagnosed previously,
+ there should be at least two wide characters. Empty literals
+ are diagnosed earlier and we can get just the zero terminator
+ only if there were errors diagnosed during conversion. */
+ *pchars_seen = 0;
+ *unsignedp = 0;
+ return 0;
+ }
+
/* This is finicky because the string is in the target's byte order,
which may not be our byte order. Only the last character, ignoring
the NUL terminator, is relevant. */
cpp_string_location_reader::
cpp_string_location_reader (location_t src_loc,
line_maps *line_table)
-: m_line_table (line_table)
{
src_loc = get_range_from_loc (line_table, src_loc).m_start;