+2016-08-06 David Malcolm <dmalcolm@redhat.com>
+
+ PR bootstrap/72823
+ * charset.c (_cpp_valid_ucn): Replace overzealous assert with one
+ that allows for char_range to be non-NULL when loc_reader is NULL.
+
2016-08-05 David Malcolm <dmalcolm@redhat.com>
* charset.c (cpp_substring_ranges::cpp_substring_ranges): New
IDENTIFIER_POS is 0 when not in an identifier, 1 for the start of
an identifier, or 2 otherwise.
- If CHAR_RANGE and LOC_READER are non-NULL, then position information is
+ If LOC_READER is non-NULL, then position information is
read from *LOC_READER and CHAR_RANGE->m_finish is updated accordingly. */
bool
const uchar *str = *pstr;
const uchar *base = str - 2;
- /* char_range and loc_reader must either be both NULL, or both be
- non-NULL. */
- gcc_assert ((char_range != NULL) == (loc_reader != NULL));
-
if (!CPP_OPTION (pfile, cplusplus) && !CPP_OPTION (pfile, c99))
cpp_error (pfile, CPP_DL_WARNING,
"universal character names are only valid in C++ and C99");
break;
str++;
if (loc_reader)
- char_range->m_finish = loc_reader->get_next ().m_finish;
+ {
+ gcc_assert (char_range);
+ char_range->m_finish = loc_reader->get_next ().m_finish;
+ }
result = (result << 4) + hex_value (c);
}
while (--length && str < limit);