diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 62f1b00cd7a..b6bc608a223 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -2846,9 +2846,13 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok) if (tok->type == CPP_WSTRING) wide = true; /* APPLE LOCAL begin pascal strings */ - else if (CPP_OPTION (parse_in, pascal_strings) - && str.text[1] == '\\' && str.text[2] == 'p') - pascal_p = true; + if (CPP_OPTION (parse_in, pascal_strings)) + { + if (wide && str.text[0] == 'L' && str.text[2] == '\\' && str.text[3] == 'p') + pascal_p = true; + else if (str.text[1] == '\\' && str.text[2] == 'p') + pascal_p = true; + } /* APPLE LOCAL end pascal strings */ strs = &str; @@ -2867,9 +2871,13 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok) if (tok->type == CPP_WSTRING) wide = true; /* APPLE LOCAL begin pascal strings */ - else if (count == 1 && CPP_OPTION (parse_in, pascal_strings) - && str.text[1] == '\\' && str.text[2] == 'p') - pascal_p = true; + if (CPP_OPTION (parse_in, pascal_strings) && count == 1) + { + if (wide && str.text[0] == 'L' && str.text[2] == '\\' && str.text[3] == 'p') + pascal_p = true; + else if (str.text[1] == '\\' && str.text[2] == 'p') + pascal_p = true; + } /* APPLE LOCAL end pascal strings */ obstack_grow (&str_ob, &str, sizeof (cpp_string)); @@ -2887,11 +2895,6 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok) wide = false; } - /* APPLE LOCAL begin pascal strings */ - if (wide) - pascal_p = false; - /* APPLE LOCAL end pascal strings */ - if ((translate ? cpp_interpret_string : cpp_interpret_string_notranslate) /* APPLE LOCAL pascal strings */ (parse_in, strs, count, &istr, wide, pascal_p)) |