diff options
author | Jakub Jelinek <jakub@redhat.com> | 2010-05-25 18:17:32 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2010-05-25 18:17:32 +0200 |
commit | 9602a7a9c8f9ab271f4672a080c17c8b21d0dc14 (patch) | |
tree | 2069f1c069eb4e716f48eb0303a048ee3cc46b96 /gcc/cp | |
parent | 60a5d78a724cc604ca54605db99cc62fcc82f53b (diff) | |
download | gcc-9602a7a9c8f9ab271f4672a080c17c8b21d0dc14.zip gcc-9602a7a9c8f9ab271f4672a080c17c8b21d0dc14.tar.gz gcc-9602a7a9c8f9ab271f4672a080c17c8b21d0dc14.tar.bz2 |
re PR c++/18249 (C++ parser i18n problems)
PR c++/18249
* parser.c (non_integral_constant): Add NIC_NONE.
(required_token): Add RT_NONE.
(cp_parser_unary_expression): Initialize non_constant_p
to NIC_NONE.
(cp_parser_asm_definition): Initialize missing to RT_NONE.
(cp_parser_primary_expression, cp_parser_postfix_expression,
cp_parser_cast_expression, cp_parser_binary_expression,
cp_parser_functional_cast): Fix formatting.
From-SVN: r159827
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 12 | ||||
-rw-r--r-- | gcc/cp/parser.c | 29 |
2 files changed, 28 insertions, 13 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8615d2b..15807ce 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,15 @@ +2010-05-25 Jakub Jelinek <jakub@redhat.com> + + PR c++/18249 + * parser.c (non_integral_constant): Add NIC_NONE. + (required_token): Add RT_NONE. + (cp_parser_unary_expression): Initialize non_constant_p + to NIC_NONE. + (cp_parser_asm_definition): Initialize missing to RT_NONE. + (cp_parser_primary_expression, cp_parser_postfix_expression, + cp_parser_cast_expression, cp_parser_binary_expression, + cp_parser_functional_cast): Fix formatting. + 2010-05-25 Shujing Zhao <pearly.zhao@oracle.com> PR c++/18249 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ce0a27a..1cfdba7 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -1,6 +1,6 @@ /* C++ Parser. Copyright (C) 2000, 2001, 2002, 2003, 2004, - 2005, 2007, 2008, 2009 Free Software Foundation, Inc. + 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Written by Mark Mitchell <mark@codesourcery.com>. This file is part of GCC. @@ -150,6 +150,7 @@ typedef struct GTY(()) cp_token_cache { /* The various kinds of non integral constant we encounter. */ typedef enum non_integral_constant { + NIC_NONE, /* floating-point literal */ NIC_FLOAT, /* %<this%> */ @@ -218,7 +219,8 @@ typedef enum name_lookup_error { /* The various kinds of required token */ typedef enum required_token { - RT_SEMICOLON = 1, /* ';' */ + RT_NONE, + RT_SEMICOLON, /* ';' */ RT_OPEN_PAREN, /* '(' */ RT_CLOSE_BRACE, /* '}' */ RT_OPEN_BRACE, /* '{' */ @@ -3715,7 +3717,8 @@ cp_parser_primary_expression (cp_parser *parser, cp_parser_require (parser, CPP_CLOSE_PAREN, RT_CLOSE_PAREN); /* Using `va_arg' in a constant-expression is not allowed. */ - if (cp_parser_non_integral_constant_expression (parser,NIC_VA_ARG)) + if (cp_parser_non_integral_constant_expression (parser, + NIC_VA_ARG)) return error_mark_node; return build_x_va_arg (expression, type); } @@ -4842,7 +4845,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p, /* Only type conversions to integral or enumeration types can be used in constant-expressions. */ if (!cast_valid_in_integral_constant_expression_p (type) - && (cp_parser_non_integral_constant_expression (parser, NIC_CAST))) + && cp_parser_non_integral_constant_expression (parser, NIC_CAST)) return error_mark_node; switch (keyword) @@ -5895,7 +5898,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, { tree cast_expression; tree expression = error_mark_node; - non_integral_constant non_constant_p = 0; + non_integral_constant non_constant_p = NIC_NONE; /* Consume the operator token. */ token = cp_lexer_consume_token (parser->lexer); @@ -5936,7 +5939,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p, gcc_unreachable (); } - if (non_constant_p + if (non_constant_p != NIC_NONE && cp_parser_non_integral_constant_expression (parser, non_constant_p)) expression = error_mark_node; @@ -6503,8 +6506,8 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p, bool cast_p, /* Only type conversions to integral or enumeration types can be used in constant-expressions. */ if (!cast_valid_in_integral_constant_expression_p (type) - && (cp_parser_non_integral_constant_expression (parser, - NIC_CAST))) + && cp_parser_non_integral_constant_expression (parser, + NIC_CAST)) return error_mark_node; /* Perform the cast. */ @@ -6739,8 +6742,8 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, least one of the operands is of enumeration type. */ if (overloaded_p - && (cp_parser_non_integral_constant_expression (parser, - NIC_OVERLOADED))) + && cp_parser_non_integral_constant_expression (parser, + NIC_OVERLOADED)) return error_mark_node; } @@ -13475,7 +13478,7 @@ cp_parser_asm_definition (cp_parser* parser) bool invalid_inputs_p = false; bool invalid_outputs_p = false; bool goto_p = false; - required_token missing = 0; + required_token missing = RT_NONE; /* Look for the `asm' keyword. */ cp_parser_require_keyword (parser, RID_ASM, RT_ASM); @@ -19258,8 +19261,8 @@ cp_parser_functional_cast (cp_parser* parser, tree type) type = TREE_TYPE (type); if (cast != error_mark_node && !cast_valid_in_integral_constant_expression_p (type) - && (cp_parser_non_integral_constant_expression (parser, - NIC_CONSTRUCTOR))) + && cp_parser_non_integral_constant_expression (parser, + NIC_CONSTRUCTOR)) return error_mark_node; return cast; } |