Commit 98ca843c by Eric Christopher Committed by Eric Christopher

parser.c (cp_parser_class_head): Remove unused variable.

2004-07-12  Eric Christopher  <echristo@redhat.com>

        * parser.c (cp_parser_class_head): Remove unused variable.

From-SVN: r84571
parent dd4e1500
2004-07-12 Eric Christopher <echristo@redhat.com>
* parser.c (cp_parser_class_head): Remove unused variable.
2004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org> 2004-07-12 Giovanni Bajo <giovannibajo@gcc.gnu.org>
* decl.c (grok_op_properties): Reject [de-]allocation functions * decl.c (grok_op_properties): Reject [de-]allocation functions
...@@ -9,7 +13,7 @@ ...@@ -9,7 +13,7 @@
* decl.c (xref_basetypes): Use make_tree_binfo directly. * decl.c (xref_basetypes): Use make_tree_binfo directly.
* tree.h (copy_base_binfos): Likewise. * tree.h (copy_base_binfos): Likewise.
(make_binfo): Remove. (make_binfo): Remove.
* call.c (build_user_type_conversion_1, build_new_op, * call.c (build_user_type_conversion_1, build_new_op,
check_constructor_callable, build_temp, check_constructor_callable, build_temp,
perform_direct_initialization_of_possible): Pass type directly to perform_direct_initialization_of_possible): Pass type directly to
......
...@@ -1015,19 +1015,19 @@ clear_decl_specs (cp_decl_specifier_seq *decl_specs) ...@@ -1015,19 +1015,19 @@ clear_decl_specs (cp_decl_specifier_seq *decl_specs)
Other parts of the front end that need to create entities (like Other parts of the front end that need to create entities (like
VAR_DECLs or FUNCTION_DECLs) should do that directly. */ VAR_DECLs or FUNCTION_DECLs) should do that directly. */
static cp_declarator *make_id_declarator static cp_declarator *make_id_declarator
(tree); (tree);
static cp_declarator *make_call_declarator static cp_declarator *make_call_declarator
(cp_declarator *, cp_parameter_declarator *, cp_cv_quals, tree); (cp_declarator *, cp_parameter_declarator *, cp_cv_quals, tree);
static cp_declarator *make_array_declarator static cp_declarator *make_array_declarator
(cp_declarator *, tree); (cp_declarator *, tree);
static cp_declarator *make_pointer_declarator static cp_declarator *make_pointer_declarator
(cp_cv_quals, cp_declarator *); (cp_cv_quals, cp_declarator *);
static cp_declarator *make_reference_declarator static cp_declarator *make_reference_declarator
(cp_cv_quals, cp_declarator *); (cp_cv_quals, cp_declarator *);
static cp_parameter_declarator *make_parameter_declarator static cp_parameter_declarator *make_parameter_declarator
(cp_decl_specifier_seq *, cp_declarator *, tree); (cp_decl_specifier_seq *, cp_declarator *, tree);
static cp_declarator *make_ptrmem_declarator static cp_declarator *make_ptrmem_declarator
(cp_cv_quals, tree, cp_declarator *); (cp_cv_quals, tree, cp_declarator *);
cp_declarator *cp_error_declarator; cp_declarator *cp_error_declarator;
...@@ -1066,7 +1066,7 @@ cp_declarator * ...@@ -1066,7 +1066,7 @@ cp_declarator *
make_id_declarator (tree id) make_id_declarator (tree id)
{ {
cp_declarator *declarator; cp_declarator *declarator;
declarator = make_declarator (cdk_id); declarator = make_declarator (cdk_id);
declarator->u.id.name = id; declarator->u.id.name = id;
declarator->u.id.sfk = sfk_none; declarator->u.id.sfk = sfk_none;
...@@ -1129,7 +1129,7 @@ make_ptrmem_declarator (cp_cv_quals cv_qualifiers, tree class_type, ...@@ -1129,7 +1129,7 @@ make_ptrmem_declarator (cp_cv_quals cv_qualifiers, tree class_type,
indicates what exceptions can be thrown. */ indicates what exceptions can be thrown. */
cp_declarator * cp_declarator *
make_call_declarator (cp_declarator *target, make_call_declarator (cp_declarator *target,
cp_parameter_declarator *parms, cp_parameter_declarator *parms,
cp_cv_quals cv_qualifiers, cp_cv_quals cv_qualifiers,
tree exception_specification) tree exception_specification)
...@@ -1166,13 +1166,13 @@ cp_parameter_declarator *no_parameters; ...@@ -1166,13 +1166,13 @@ cp_parameter_declarator *no_parameters;
DECLARATOR and DEFAULT_ARGUMENT. */ DECLARATOR and DEFAULT_ARGUMENT. */
cp_parameter_declarator * cp_parameter_declarator *
make_parameter_declarator (cp_decl_specifier_seq *decl_specifiers, make_parameter_declarator (cp_decl_specifier_seq *decl_specifiers,
cp_declarator *declarator, cp_declarator *declarator,
tree default_argument) tree default_argument)
{ {
cp_parameter_declarator *parameter; cp_parameter_declarator *parameter;
parameter = ((cp_parameter_declarator *) parameter = ((cp_parameter_declarator *)
alloc_declarator (sizeof (cp_parameter_declarator))); alloc_declarator (sizeof (cp_parameter_declarator)));
parameter->next = NULL; parameter->next = NULL;
if (decl_specifiers) if (decl_specifiers)
...@@ -1650,7 +1650,7 @@ static tree cp_parser_storage_class_specifier_opt ...@@ -1650,7 +1650,7 @@ static tree cp_parser_storage_class_specifier_opt
static tree cp_parser_function_specifier_opt static tree cp_parser_function_specifier_opt
(cp_parser *, cp_decl_specifier_seq *); (cp_parser *, cp_decl_specifier_seq *);
static tree cp_parser_type_specifier static tree cp_parser_type_specifier
(cp_parser *, cp_parser_flags, cp_decl_specifier_seq *, bool, (cp_parser *, cp_parser_flags, cp_decl_specifier_seq *, bool,
int *, bool *); int *, bool *);
static tree cp_parser_simple_type_specifier static tree cp_parser_simple_type_specifier
(cp_parser *, cp_decl_specifier_seq *, cp_parser_flags); (cp_parser *, cp_decl_specifier_seq *, cp_parser_flags);
...@@ -1874,7 +1874,7 @@ static bool cp_parser_declares_only_class_p ...@@ -1874,7 +1874,7 @@ static bool cp_parser_declares_only_class_p
(cp_parser *); (cp_parser *);
static void cp_parser_set_storage_class static void cp_parser_set_storage_class
(cp_decl_specifier_seq *, cp_storage_class); (cp_decl_specifier_seq *, cp_storage_class);
static void cp_parser_set_decl_spec_type static void cp_parser_set_decl_spec_type
(cp_decl_specifier_seq *, tree, bool); (cp_decl_specifier_seq *, tree, bool);
static bool cp_parser_friend_p static bool cp_parser_friend_p
(const cp_decl_specifier_seq *); (const cp_decl_specifier_seq *);
...@@ -2623,7 +2623,7 @@ cp_parser_translation_unit (cp_parser* parser) ...@@ -2623,7 +2623,7 @@ cp_parser_translation_unit (cp_parser* parser)
static void *declarator_obstack_base; static void *declarator_obstack_base;
bool success; bool success;
/* Create the declarator obstack, if necessary. */ /* Create the declarator obstack, if necessary. */
if (!cp_error_declarator) if (!cp_error_declarator)
{ {
...@@ -2645,7 +2645,7 @@ cp_parser_translation_unit (cp_parser* parser) ...@@ -2645,7 +2645,7 @@ cp_parser_translation_unit (cp_parser* parser)
{ {
/* Consume the EOF token. */ /* Consume the EOF token. */
cp_parser_require (parser, CPP_EOF, "end-of-file"); cp_parser_require (parser, CPP_EOF, "end-of-file");
/* Finish up. */ /* Finish up. */
finish_translation_unit (); finish_translation_unit ();
...@@ -3764,7 +3764,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) ...@@ -3764,7 +3764,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
if (parser->integral_constant_expression_p if (parser->integral_constant_expression_p
&& !dependent_type_p (type) && !dependent_type_p (type)
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (type) && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)
&& (cp_parser_non_integral_constant_expression && (cp_parser_non_integral_constant_expression
(parser, (parser,
"a cast to a type other than an integral or " "a cast to a type other than an integral or "
"enumeration type"))) "enumeration type")))
...@@ -3836,7 +3836,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) ...@@ -3836,7 +3836,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
} }
/* `typeid' may not appear in an integral constant expression. */ /* `typeid' may not appear in an integral constant expression. */
if (cp_parser_non_integral_constant_expression(parser, if (cp_parser_non_integral_constant_expression(parser,
"`typeid' operator")) "`typeid' operator"))
return error_mark_node; return error_mark_node;
/* Restore the saved message. */ /* Restore the saved message. */
...@@ -3881,7 +3881,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) ...@@ -3881,7 +3881,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* Create a TYPENAME_TYPE to represent the type to which the /* Create a TYPENAME_TYPE to represent the type to which the
functional cast is being performed. */ functional cast is being performed. */
else else
type = make_typename_type (parser->scope, id, type = make_typename_type (parser->scope, id,
/*complain=*/1); /*complain=*/1);
postfix_expression = cp_parser_functional_cast (parser, type); postfix_expression = cp_parser_functional_cast (parser, type);
...@@ -4114,7 +4114,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p) ...@@ -4114,7 +4114,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
postfix-expression . pseudo-destructor-name postfix-expression . pseudo-destructor-name
postfix-expression -> template [opt] id-expression postfix-expression -> template [opt] id-expression
postfix-expression -> pseudo-destructor-name */ postfix-expression -> pseudo-destructor-name */
/* Consume the `.' or `->' operator. */ /* Consume the `.' or `->' operator. */
cp_lexer_consume_token (parser->lexer); cp_lexer_consume_token (parser->lexer);
...@@ -4308,7 +4308,7 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, ...@@ -4308,7 +4308,7 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser,
parser->object_scope = NULL_TREE; parser->object_scope = NULL_TREE;
} }
if (scope && name && BASELINK_P (name)) if (scope && name && BASELINK_P (name))
adjust_result_of_qualified_name_lookup adjust_result_of_qualified_name_lookup
(name, BINFO_TYPE (BASELINK_BINFO (name)), scope); (name, BINFO_TYPE (BASELINK_BINFO (name)), scope);
postfix_expression postfix_expression
= finish_class_member_access_expr (postfix_expression, name); = finish_class_member_access_expr (postfix_expression, name);
...@@ -4334,7 +4334,7 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser, ...@@ -4334,7 +4334,7 @@ cp_parser_postfix_dot_deref_expression (cp_parser *parser,
/* Outside of offsetof, these operators may not appear in /* Outside of offsetof, these operators may not appear in
constant-expressions. */ constant-expressions. */
if (!for_offsetof if (!for_offsetof
&& (cp_parser_non_integral_constant_expression && (cp_parser_non_integral_constant_expression
(parser, token_type == CPP_DEREF ? "'->'" : "`.'"))) (parser, token_type == CPP_DEREF ? "'->'" : "`.'")))
postfix_expression = error_mark_node; postfix_expression = error_mark_node;
...@@ -4723,7 +4723,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p) ...@@ -4723,7 +4723,7 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p)
abort (); abort ();
} }
if (non_constant_p if (non_constant_p
&& cp_parser_non_integral_constant_expression (parser, && cp_parser_non_integral_constant_expression (parser,
non_constant_p)) non_constant_p))
expression = error_mark_node; expression = error_mark_node;
...@@ -4808,7 +4808,7 @@ cp_parser_new_expression (cp_parser* parser) ...@@ -4808,7 +4808,7 @@ cp_parser_new_expression (cp_parser* parser)
type = cp_parser_type_id (parser); type = cp_parser_type_id (parser);
/* Look for the closing `)'. */ /* Look for the closing `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
/* There should not be a direct-new-declarator in this production, /* There should not be a direct-new-declarator in this production,
but GCC used to allowed this, so we check and emit a sensible error but GCC used to allowed this, so we check and emit a sensible error
message for this case. */ message for this case. */
if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE)) if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_SQUARE))
...@@ -4902,7 +4902,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) ...@@ -4902,7 +4902,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts)
outer_declarator = declarator; outer_declarator = declarator;
declarator = declarator->declarator; declarator = declarator->declarator;
} }
while (declarator while (declarator
&& declarator->kind == cdk_array && declarator->kind == cdk_array
&& declarator->declarator && declarator->declarator
&& declarator->declarator->kind == cdk_array) && declarator->declarator->kind == cdk_array)
...@@ -4910,7 +4910,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) ...@@ -4910,7 +4910,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts)
outer_declarator = declarator; outer_declarator = declarator;
declarator = declarator->declarator; declarator = declarator->declarator;
} }
if (declarator && declarator->kind == cdk_array) if (declarator && declarator->kind == cdk_array)
{ {
*nelts = declarator->u.array.bounds; *nelts = declarator->u.array.bounds;
...@@ -4918,7 +4918,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts) ...@@ -4918,7 +4918,7 @@ cp_parser_new_type_id (cp_parser* parser, tree *nelts)
*nelts = integer_one_node; *nelts = integer_one_node;
else if (!processing_template_decl) else if (!processing_template_decl)
{ {
if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, *nelts, if (!build_expr_type_conversion (WANT_INT | WANT_ENUM, *nelts,
false)) false))
pedwarn ("size in array new must have integral type"); pedwarn ("size in array new must have integral type");
*nelts = save_expr (cp_convert (sizetype, *nelts)); *nelts = save_expr (cp_convert (sizetype, *nelts));
...@@ -5210,7 +5210,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p) ...@@ -5210,7 +5210,7 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p)
if (parser->integral_constant_expression_p if (parser->integral_constant_expression_p
&& !dependent_type_p (type) && !dependent_type_p (type)
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (type) && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)
&& (cp_parser_non_integral_constant_expression && (cp_parser_non_integral_constant_expression
(parser, (parser,
"a cast to a type other than an integral or " "a cast to a type other than an integral or "
"enumeration type"))) "enumeration type")))
...@@ -6443,7 +6443,7 @@ cp_parser_iteration_statement (cp_parser* parser) ...@@ -6443,7 +6443,7 @@ cp_parser_iteration_statement (cp_parser* parser)
finish_for_expr (expression, statement); finish_for_expr (expression, statement);
/* Look for the `)'. */ /* Look for the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"); cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
/* Parse the body of the for-statement. */ /* Parse the body of the for-statement. */
parser->in_iteration_statement_p = true; parser->in_iteration_statement_p = true;
cp_parser_already_scoped_statement (parser); cp_parser_already_scoped_statement (parser);
...@@ -6953,7 +6953,7 @@ cp_parser_simple_declaration (cp_parser* parser, ...@@ -6953,7 +6953,7 @@ cp_parser_simple_declaration (cp_parser* parser,
/* In a block scope, a valid declaration must always have a /* In a block scope, a valid declaration must always have a
decl-specifier-seq. By not trying to parse declarators, we can decl-specifier-seq. By not trying to parse declarators, we can
resolve the declaration/expression ambiguity more quickly. */ resolve the declaration/expression ambiguity more quickly. */
if (!function_definition_allowed_p if (!function_definition_allowed_p
&& !decl_specifiers.any_specifiers_p) && !decl_specifiers.any_specifiers_p)
{ {
cp_parser_error (parser, "expected declaration"); cp_parser_error (parser, "expected declaration");
...@@ -7094,7 +7094,7 @@ cp_parser_simple_declaration (cp_parser* parser, ...@@ -7094,7 +7094,7 @@ cp_parser_simple_declaration (cp_parser* parser,
(i.e., a type declaration) (i.e., a type declaration)
2: one of the decl-specifiers is an enum-specifier or a 2: one of the decl-specifiers is an enum-specifier or a
class-specifier (i.e., a type definition) class-specifier (i.e., a type definition)
*/ */
static void static void
...@@ -7124,7 +7124,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser, ...@@ -7124,7 +7124,7 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
if (token->keyword == RID_ATTRIBUTE) if (token->keyword == RID_ATTRIBUTE)
{ {
/* Parse the attributes. */ /* Parse the attributes. */
decl_specs->attributes decl_specs->attributes
= chainon (decl_specs->attributes, = chainon (decl_specs->attributes,
cp_parser_attributes_opt (parser)); cp_parser_attributes_opt (parser));
continue; continue;
...@@ -7225,10 +7225,10 @@ cp_parser_decl_specifier_seq (cp_parser* parser, ...@@ -7225,10 +7225,10 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
/* Constructors are a special case. The `S' in `S()' is not a /* Constructors are a special case. The `S' in `S()' is not a
decl-specifier; it is the beginning of the declarator. */ decl-specifier; it is the beginning of the declarator. */
constructor_p constructor_p
= (!found_decl_spec = (!found_decl_spec
&& constructor_possible_p && constructor_possible_p
&& (cp_parser_constructor_declarator_p && (cp_parser_constructor_declarator_p
(parser, decl_specs->specs[(int) ds_friend] != 0))); (parser, decl_specs->specs[(int) ds_friend] != 0)));
/* If we don't have a DECL_SPEC yet, then we must be looking at /* If we don't have a DECL_SPEC yet, then we must be looking at
...@@ -7570,10 +7570,10 @@ cp_parser_conversion_declarator_opt (cp_parser* parser) ...@@ -7570,10 +7570,10 @@ cp_parser_conversion_declarator_opt (cp_parser* parser)
if (cp_parser_parse_definitely (parser)) if (cp_parser_parse_definitely (parser))
{ {
cp_declarator *declarator; cp_declarator *declarator;
/* Parse another optional declarator. */ /* Parse another optional declarator. */
declarator = cp_parser_conversion_declarator_opt (parser); declarator = cp_parser_conversion_declarator_opt (parser);
/* Create the representation of the declarator. */ /* Create the representation of the declarator. */
if (class_type) if (class_type)
declarator = make_ptrmem_declarator (cv_quals, class_type, declarator = make_ptrmem_declarator (cv_quals, class_type,
...@@ -7582,7 +7582,7 @@ cp_parser_conversion_declarator_opt (cp_parser* parser) ...@@ -7582,7 +7582,7 @@ cp_parser_conversion_declarator_opt (cp_parser* parser)
declarator = make_pointer_declarator (cv_quals, declarator); declarator = make_pointer_declarator (cv_quals, declarator);
else else
declarator = make_reference_declarator (cv_quals, declarator); declarator = make_reference_declarator (cv_quals, declarator);
return declarator; return declarator;
} }
...@@ -8193,11 +8193,11 @@ cp_parser_template_parameter (cp_parser* parser, bool *is_non_type) ...@@ -8193,11 +8193,11 @@ cp_parser_template_parameter (cp_parser* parser, bool *is_non_type)
parameter_declarator parameter_declarator
= cp_parser_parameter_declaration (parser, /*template_parm_p=*/true, = cp_parser_parameter_declaration (parser, /*template_parm_p=*/true,
/*parenthesized_p=*/NULL); /*parenthesized_p=*/NULL);
return (build_tree_list return (build_tree_list
(parameter_declarator->default_argument, (parameter_declarator->default_argument,
grokdeclarator (parameter_declarator->declarator, grokdeclarator (parameter_declarator->declarator,
&parameter_declarator->decl_specifiers, &parameter_declarator->decl_specifiers,
PARM, /*initialized=*/0, PARM, /*initialized=*/0,
/*attrlist=*/NULL))); /*attrlist=*/NULL)));
} }
...@@ -8690,7 +8690,7 @@ cp_parser_template_name (cp_parser* parser, ...@@ -8690,7 +8690,7 @@ cp_parser_template_name (cp_parser* parser,
(and must) do name-lookup normally. */ (and must) do name-lookup normally. */
if (template_keyword_p if (template_keyword_p
&& (!parser->scope && (!parser->scope
|| (TYPE_P (parser->scope) || (TYPE_P (parser->scope)
&& dependent_type_p (parser->scope)))) && dependent_type_p (parser->scope))))
return identifier; return identifier;
} }
...@@ -9045,7 +9045,7 @@ cp_parser_explicit_instantiation (cp_parser* parser) ...@@ -9045,7 +9045,7 @@ cp_parser_explicit_instantiation (cp_parser* parser)
extension_specifier extension_specifier
= cp_parser_storage_class_specifier_opt (parser); = cp_parser_storage_class_specifier_opt (parser);
if (!extension_specifier) if (!extension_specifier)
extension_specifier extension_specifier
= cp_parser_function_specifier_opt (parser, = cp_parser_function_specifier_opt (parser,
/*decl_specs=*/NULL); /*decl_specs=*/NULL);
} }
...@@ -9252,8 +9252,8 @@ cp_parser_type_specifier (cp_parser* parser, ...@@ -9252,8 +9252,8 @@ cp_parser_type_specifier (cp_parser* parser,
case RID_TYPENAME: case RID_TYPENAME:
/* Look for an elaborated-type-specifier. */ /* Look for an elaborated-type-specifier. */
type_spec type_spec
= (cp_parser_elaborated_type_specifier = (cp_parser_elaborated_type_specifier
(parser, (parser,
decl_specs && decl_specs->specs[(int) ds_friend], decl_specs && decl_specs->specs[(int) ds_friend],
is_declaration)); is_declaration));
...@@ -9272,7 +9272,7 @@ cp_parser_type_specifier (cp_parser* parser, ...@@ -9272,7 +9272,7 @@ cp_parser_type_specifier (cp_parser* parser,
if (is_cv_qualifier) if (is_cv_qualifier)
*is_cv_qualifier = true; *is_cv_qualifier = true;
break; break;
case RID_VOLATILE: case RID_VOLATILE:
ds = ds_volatile; ds = ds_volatile;
if (is_cv_qualifier) if (is_cv_qualifier)
...@@ -9307,7 +9307,7 @@ cp_parser_type_specifier (cp_parser* parser, ...@@ -9307,7 +9307,7 @@ cp_parser_type_specifier (cp_parser* parser,
/* If we do not already have a type-specifier, assume we are looking /* If we do not already have a type-specifier, assume we are looking
at a simple-type-specifier. */ at a simple-type-specifier. */
type_spec = cp_parser_simple_type_specifier (parser, type_spec = cp_parser_simple_type_specifier (parser,
decl_specs, decl_specs,
flags); flags);
...@@ -9349,7 +9349,7 @@ cp_parser_type_specifier (cp_parser* parser, ...@@ -9349,7 +9349,7 @@ cp_parser_type_specifier (cp_parser* parser,
appropriately updated. */ appropriately updated. */
static tree static tree
cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_simple_type_specifier (cp_parser* parser,
cp_decl_specifier_seq *decl_specs, cp_decl_specifier_seq *decl_specs,
cp_parser_flags flags) cp_parser_flags flags)
{ {
...@@ -9420,7 +9420,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, ...@@ -9420,7 +9420,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
if (decl_specs) if (decl_specs)
cp_parser_set_decl_spec_type (decl_specs, type, cp_parser_set_decl_spec_type (decl_specs, type,
/*user_defined_p=*/true); /*user_defined_p=*/true);
return type; return type;
default: default:
...@@ -9438,7 +9438,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, ...@@ -9438,7 +9438,7 @@ cp_parser_simple_type_specifier (cp_parser* parser,
&& token->keyword != RID_UNSIGNED && token->keyword != RID_UNSIGNED
&& token->keyword != RID_SHORT && token->keyword != RID_SHORT
&& token->keyword != RID_LONG)) && token->keyword != RID_LONG))
cp_parser_set_decl_spec_type (decl_specs, cp_parser_set_decl_spec_type (decl_specs,
type, type,
/*user_defined=*/false); /*user_defined=*/false);
if (decl_specs) if (decl_specs)
...@@ -9498,9 +9498,9 @@ cp_parser_simple_type_specifier (cp_parser* parser, ...@@ -9498,9 +9498,9 @@ cp_parser_simple_type_specifier (cp_parser* parser,
else else
type = cp_parser_type_name (parser); type = cp_parser_type_name (parser);
/* Keep track of all name-lookups performed in class scopes. */ /* Keep track of all name-lookups performed in class scopes. */
if (type if (type
&& !qualified_p && !qualified_p
&& TREE_CODE (type) == TYPE_DECL && TREE_CODE (type) == TYPE_DECL
&& TREE_CODE (DECL_NAME (type)) == IDENTIFIER_NODE) && TREE_CODE (DECL_NAME (type)) == IDENTIFIER_NODE)
maybe_note_name_used_in_class (DECL_NAME (type), type); maybe_note_name_used_in_class (DECL_NAME (type), type);
/* If it didn't work out, we don't have a TYPE. */ /* If it didn't work out, we don't have a TYPE. */
...@@ -11149,12 +11149,12 @@ cp_parser_direct_declarator (cp_parser* parser, ...@@ -11149,12 +11149,12 @@ cp_parser_direct_declarator (cp_parser* parser,
if (ctor_dtor_or_conv_p && declarator->u.id.sfk != sfk_none) if (ctor_dtor_or_conv_p && declarator->u.id.sfk != sfk_none)
*ctor_dtor_or_conv_p = -1; *ctor_dtor_or_conv_p = -1;
if (TREE_CODE (id) == SCOPE_REF if (TREE_CODE (id) == SCOPE_REF
&& TREE_CODE (unqualified_name) == TYPE_DECL && TREE_CODE (unqualified_name) == TYPE_DECL
&& CLASSTYPE_USE_TEMPLATE (TREE_TYPE (unqualified_name))) && CLASSTYPE_USE_TEMPLATE (TREE_TYPE (unqualified_name)))
{ {
error ("invalid use of constructor as a template"); error ("invalid use of constructor as a template");
inform ("use `%T::%D' instead of `%T::%T' to name the " inform ("use `%T::%D' instead of `%T::%T' to name the "
"constructor in a qualified name", class_type, "constructor in a qualified name", class_type,
DECL_NAME (TYPE_TI_TEMPLATE (class_type)), DECL_NAME (TYPE_TI_TEMPLATE (class_type)),
class_type, class_type); class_type, class_type);
} }
...@@ -11299,7 +11299,7 @@ cp_parser_ptr_operator (cp_parser* parser, ...@@ -11299,7 +11299,7 @@ cp_parser_ptr_operator (cp_parser* parser,
GNU Extension: GNU Extension:
cv-qualifier: cv-qualifier:
__restrict__ __restrict__
Returns a bitmask representing the cv-qualifiers. */ Returns a bitmask representing the cv-qualifiers. */
...@@ -11312,7 +11312,7 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser) ...@@ -11312,7 +11312,7 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser)
{ {
cp_token *token; cp_token *token;
cp_cv_quals cv_qualifier; cp_cv_quals cv_qualifier;
/* Peek at the next token. */ /* Peek at the next token. */
token = cp_lexer_peek_token (parser->lexer); token = cp_lexer_peek_token (parser->lexer);
/* See if it's a cv-qualifier. */ /* See if it's a cv-qualifier. */
...@@ -11321,20 +11321,20 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser) ...@@ -11321,20 +11321,20 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser)
case RID_CONST: case RID_CONST:
cv_qualifier = TYPE_QUAL_CONST; cv_qualifier = TYPE_QUAL_CONST;
break; break;
case RID_VOLATILE: case RID_VOLATILE:
cv_qualifier = TYPE_QUAL_VOLATILE; cv_qualifier = TYPE_QUAL_VOLATILE;
break; break;
case RID_RESTRICT: case RID_RESTRICT:
cv_qualifier = TYPE_QUAL_RESTRICT; cv_qualifier = TYPE_QUAL_RESTRICT;
break; break;
default: default:
cv_qualifier = TYPE_UNQUALIFIED; cv_qualifier = TYPE_UNQUALIFIED;
break; break;
} }
if (!cv_qualifier) if (!cv_qualifier)
break; break;
...@@ -11461,7 +11461,7 @@ cp_parser_type_specifier_seq (cp_parser* parser, ...@@ -11461,7 +11461,7 @@ cp_parser_type_specifier_seq (cp_parser* parser,
/* Check for attributes first. */ /* Check for attributes first. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ATTRIBUTE)) if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ATTRIBUTE))
{ {
type_specifier_seq->attributes = type_specifier_seq->attributes =
chainon (type_specifier_seq->attributes, chainon (type_specifier_seq->attributes,
cp_parser_attributes_opt (parser)); cp_parser_attributes_opt (parser));
continue; continue;
...@@ -11576,7 +11576,7 @@ cp_parser_parameter_declaration_clause (cp_parser* parser) ...@@ -11576,7 +11576,7 @@ cp_parser_parameter_declaration_clause (cp_parser* parser)
/* Finish the parameter list. */ /* Finish the parameter list. */
if (parameters && ellipsis_p) if (parameters && ellipsis_p)
parameters->ellipsis_p = true; parameters->ellipsis_p = true;
return parameters; return parameters;
} }
...@@ -11782,7 +11782,7 @@ cp_parser_parameter_declaration (cp_parser *parser, ...@@ -11782,7 +11782,7 @@ cp_parser_parameter_declaration (cp_parser *parser,
parser->default_arg_ok_p = saved_default_arg_ok_p; parser->default_arg_ok_p = saved_default_arg_ok_p;
/* After the declarator, allow more attributes. */ /* After the declarator, allow more attributes. */
decl_specifiers.attributes decl_specifiers.attributes
= chainon (decl_specifiers.attributes, = chainon (decl_specifiers.attributes,
cp_parser_attributes_opt (parser)); cp_parser_attributes_opt (parser));
} }
...@@ -12040,7 +12040,7 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p) ...@@ -12040,7 +12040,7 @@ cp_parser_initializer_clause (cp_parser* parser, bool* non_constant_p)
assignment-expression. */ assignment-expression. */
if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)) if (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
{ {
initializer initializer
= cp_parser_constant_expression (parser, = cp_parser_constant_expression (parser,
/*allow_non_constant_p=*/true, /*allow_non_constant_p=*/true,
non_constant_p); non_constant_p);
...@@ -12338,14 +12338,14 @@ cp_parser_class_specifier (cp_parser* parser) ...@@ -12338,14 +12338,14 @@ cp_parser_class_specifier (cp_parser* parser)
if (nested_name_specifier_p) if (nested_name_specifier_p)
pop_p = push_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (type))); pop_p = push_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (type)));
type = begin_class_definition (type); type = begin_class_definition (type);
if (type == error_mark_node) if (type == error_mark_node)
/* If the type is erroneous, skip the entire body of the class. */ /* If the type is erroneous, skip the entire body of the class. */
cp_parser_skip_to_closing_brace (parser); cp_parser_skip_to_closing_brace (parser);
else else
/* Parse the member-specification. */ /* Parse the member-specification. */
cp_parser_member_specification_opt (parser); cp_parser_member_specification_opt (parser);
/* Look for the trailing `}'. */ /* Look for the trailing `}'. */
cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'"); cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
/* We get better error messages by noticing a common problem: a /* We get better error messages by noticing a common problem: a
...@@ -12482,7 +12482,6 @@ cp_parser_class_head (cp_parser* parser, ...@@ -12482,7 +12482,6 @@ cp_parser_class_head (cp_parser* parser,
bool* nested_name_specifier_p, bool* nested_name_specifier_p,
tree *attributes_p) tree *attributes_p)
{ {
cp_token *token;
tree nested_name_specifier; tree nested_name_specifier;
enum tag_types class_key; enum tag_types class_key;
tree id = NULL_TREE; tree id = NULL_TREE;
...@@ -12771,13 +12770,13 @@ cp_parser_class_head (cp_parser* parser, ...@@ -12771,13 +12770,13 @@ cp_parser_class_head (cp_parser* parser,
is valid. */ is valid. */
if (nested_name_specifier) if (nested_name_specifier)
pop_p = push_scope (nested_name_specifier); pop_p = push_scope (nested_name_specifier);
bases = NULL_TREE; bases = NULL_TREE;
/* Get the list of base-classes, if there is one. */ /* Get the list of base-classes, if there is one. */
if (cp_lexer_next_token_is (parser->lexer, CPP_COLON)) if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
bases = cp_parser_base_clause (parser); bases = cp_parser_base_clause (parser);
/* Process the base classes. */ /* Process the base classes. */
xref_basetypes (type, bases); xref_basetypes (type, bases);
...@@ -12988,7 +12987,7 @@ cp_parser_member_declaration (cp_parser* parser) ...@@ -12988,7 +12987,7 @@ cp_parser_member_declaration (cp_parser* parser)
A<T>::B will be represented by a TYPENAME_TYPE, and A<T>::B will be represented by a TYPENAME_TYPE, and
therefore not recognized by check_tag_decl. */ therefore not recognized by check_tag_decl. */
if (!type if (!type
&& decl_specifiers.type && decl_specifiers.type
&& TYPE_P (decl_specifiers.type)) && TYPE_P (decl_specifiers.type))
type = decl_specifiers.type; type = decl_specifiers.type;
...@@ -13069,7 +13068,7 @@ cp_parser_member_declaration (cp_parser* parser) ...@@ -13069,7 +13068,7 @@ cp_parser_member_declaration (cp_parser* parser)
attributes = chainon (prefix_attributes, attributes); attributes = chainon (prefix_attributes, attributes);
/* Create the bitfield declaration. */ /* Create the bitfield declaration. */
decl = grokbitfield (identifier decl = grokbitfield (identifier
? make_id_declarator (identifier) ? make_id_declarator (identifier)
: NULL, : NULL,
&decl_specifiers, &decl_specifiers,
...@@ -14418,7 +14417,7 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser, ...@@ -14418,7 +14417,7 @@ cp_parser_check_declarator_template_parameters (cp_parser* parser,
case cdk_pointer: case cdk_pointer:
case cdk_reference: case cdk_reference:
case cdk_ptrmem: case cdk_ptrmem:
return (cp_parser_check_declarator_template_parameters return (cp_parser_check_declarator_template_parameters
(parser, declarator->declarator)); (parser, declarator->declarator));
case cdk_error: case cdk_error:
...@@ -14513,7 +14512,7 @@ cp_parser_binary_expression (cp_parser* parser, ...@@ -14513,7 +14512,7 @@ cp_parser_binary_expression (cp_parser* parser,
/* Parse the right-hand side of the expression. */ /* Parse the right-hand side of the expression. */
rhs = (*fn) (parser); rhs = (*fn) (parser);
/* Build the binary tree node. */ /* Build the binary tree node. */
lhs = build_x_binary_op (map_node->tree_type, lhs, rhs, lhs = build_x_binary_op (map_node->tree_type, lhs, rhs,
&overloaded_p); &overloaded_p);
/* If the binary operator required the use of an /* If the binary operator required the use of an
overloaded operator, then this expression cannot be an overloaded operator, then this expression cannot be an
...@@ -14522,7 +14521,7 @@ cp_parser_binary_expression (cp_parser* parser, ...@@ -14522,7 +14521,7 @@ cp_parser_binary_expression (cp_parser* parser,
permissible in an integral constant-expression if at permissible in an integral constant-expression if at
least one of the operands is of enumeration type. */ least one of the operands is of enumeration type. */
if (overloaded_p if (overloaded_p
&& (cp_parser_non_integral_constant_expression && (cp_parser_non_integral_constant_expression
(parser, "calls to overloaded operators"))) (parser, "calls to overloaded operators")))
lhs = error_mark_node; lhs = error_mark_node;
break; break;
...@@ -14883,13 +14882,13 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p) ...@@ -14883,13 +14882,13 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
/* There are no access checks when parsing a template, as we do not /* There are no access checks when parsing a template, as we do not
know if a specialization will be a friend. */ know if a specialization will be a friend. */
push_deferring_access_checks (dk_no_check); push_deferring_access_checks (dk_no_check);
decl = cp_parser_single_declaration (parser, decl = cp_parser_single_declaration (parser,
member_p, member_p,
&friend_p); &friend_p);
pop_deferring_access_checks (); pop_deferring_access_checks ();
/* If this is a member template declaration, let the front /* If this is a member template declaration, let the front
end know. */ end know. */
if (member_p && !friend_p && decl) if (member_p && !friend_p && decl)
...@@ -15024,10 +15023,10 @@ cp_parser_functional_cast (cp_parser* parser, tree type) ...@@ -15024,10 +15023,10 @@ cp_parser_functional_cast (cp_parser* parser, tree type)
cast = build_functional_cast (type, expression_list); cast = build_functional_cast (type, expression_list);
/* [expr.const]/1: In an integral constant expression "only type /* [expr.const]/1: In an integral constant expression "only type
conversions to integral or enumeration type can be used". */ conversions to integral or enumeration type can be used". */
if (cast != error_mark_node && !type_dependent_expression_p (type) if (cast != error_mark_node && !type_dependent_expression_p (type)
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (type))) && !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (type)))
{ {
if (cp_parser_non_integral_constant_expression if (cp_parser_non_integral_constant_expression
(parser, "a call to a constructor")) (parser, "a call to a constructor"))
return error_mark_node; return error_mark_node;
} }
...@@ -15442,12 +15441,12 @@ cp_parser_set_decl_spec_type (cp_decl_specifier_seq *decl_specs, ...@@ -15442,12 +15441,12 @@ cp_parser_set_decl_spec_type (cp_decl_specifier_seq *decl_specs,
bool user_defined_p) bool user_defined_p)
{ {
decl_specs->any_specifiers_p = true; decl_specs->any_specifiers_p = true;
/* If the user tries to redeclare a built-in type (with, for example, /* If the user tries to redeclare a built-in type (with, for example,
in "typedef int wchar_t;") we remember that this is what in "typedef int wchar_t;") we remember that this is what
happened. In system headers, we ignore these declarations so happened. In system headers, we ignore these declarations so
that G++ can work with system headers that are not C++-safe. */ that G++ can work with system headers that are not C++-safe. */
if (decl_specs->specs[(int) ds_typedef] if (decl_specs->specs[(int) ds_typedef]
&& !user_defined_p && !user_defined_p
&& (decl_specs->type && (decl_specs->type
|| decl_specs->specs[(int) ds_long] || decl_specs->specs[(int) ds_long]
...@@ -15805,7 +15804,7 @@ cp_parser_cache_group (cp_parser *parser, ...@@ -15805,7 +15804,7 @@ cp_parser_cache_group (cp_parser *parser,
c_lex_string_translate = -1; c_lex_string_translate = -1;
cp_parser_cache_group_1 (parser, cache, end, depth); cp_parser_cache_group_1 (parser, cache, end, depth);
c_lex_string_translate = saved_c_lex_string_translate; c_lex_string_translate = saved_c_lex_string_translate;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment