diff options
Diffstat (limited to 'gcc/c-family/c-lex.c')
-rw-r--r-- | gcc/c-family/c-lex.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/gcc/c-family/c-lex.c b/gcc/c-family/c-lex.c index d5ce9e9..0a368a3 100644 --- a/gcc/c-family/c-lex.c +++ b/gcc/c-family/c-lex.c @@ -1281,9 +1281,14 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string, bool translate) { default: case CPP_STRING: - case CPP_UTF8STRING: TREE_TYPE (value) = char_array_type_node; break; + case CPP_UTF8STRING: + if (flag_char8_t) + TREE_TYPE (value) = char8_array_type_node; + else + TREE_TYPE (value) = char_array_type_node; + break; case CPP_STRING16: TREE_TYPE (value) = char16_array_type_node; break; @@ -1323,7 +1328,12 @@ lex_charconst (const cpp_token *token) else if (token->type == CPP_CHAR16) type = char16_type_node; else if (token->type == CPP_UTF8CHAR) - type = char_type_node; + { + if (flag_char8_t) + type = char8_type_node; + else + type = char_type_node; + } /* In C, a character constant has type 'int'. In C++ 'char', but multi-char charconsts have type 'int'. */ else if (!c_dialect_cxx () || chars_seen > 1) |