Commit 31dc71a8 by Marek Polacek Committed by Marek Polacek

* c-parser.c: Add C11 references.

From-SVN: r246249
parent dba937c3
2017-03-17 Marek Polacek <polacek@redhat.com>
* c-parser.c: Add C11 references.
2017-03-15 Marek Polacek <polacek@redhat.com> 2017-03-15 Marek Polacek <polacek@redhat.com>
* c-parser.c (c_parser_enum_specifier): Remove redundant line. * c-parser.c (c_parser_enum_specifier): Remove redundant line.
......
...@@ -1316,7 +1316,7 @@ static void c_parser_cilk_grainsize (c_parser *, bool *); ...@@ -1316,7 +1316,7 @@ static void c_parser_cilk_grainsize (c_parser *, bool *);
static void c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass); static void c_parser_parse_rtl_body (c_parser *parser, char *start_with_pass);
/* Parse a translation unit (C90 6.7, C99 6.9). /* Parse a translation unit (C90 6.7, C99 6.9, C11 6.9).
translation-unit: translation-unit:
external-declarations external-declarations
...@@ -1359,7 +1359,7 @@ c_parser_translation_unit (c_parser *parser) ...@@ -1359,7 +1359,7 @@ c_parser_translation_unit (c_parser *parser)
error ("storage size of %q+D isn%'t known", decl); error ("storage size of %q+D isn%'t known", decl);
} }
/* Parse an external declaration (C90 6.7, C99 6.9). /* Parse an external declaration (C90 6.7, C99 6.9, C11 6.9).
external-declaration: external-declaration:
function-definition function-definition
...@@ -1475,8 +1475,8 @@ static void c_finish_omp_declare_simd (c_parser *, tree, tree, vec<c_token>); ...@@ -1475,8 +1475,8 @@ static void c_finish_omp_declare_simd (c_parser *, tree, tree, vec<c_token>);
static void c_finish_oacc_routine (struct oacc_routine_data *, tree, bool); static void c_finish_oacc_routine (struct oacc_routine_data *, tree, bool);
/* Parse a declaration or function definition (C90 6.5, 6.7.1, C99 /* Parse a declaration or function definition (C90 6.5, 6.7.1, C99
6.7, 6.9.1). If FNDEF_OK is true, a function definition is 6.7, 6.9.1, C11 6.7, 6.9.1). If FNDEF_OK is true, a function definition
accepted; otherwise (old-style parameter declarations) only other is accepted; otherwise (old-style parameter declarations) only other
declarations are accepted. If STATIC_ASSERT_OK is true, a static declarations are accepted. If STATIC_ASSERT_OK is true, a static
assertion is accepted; otherwise (old-style parameter declarations) assertion is accepted; otherwise (old-style parameter declarations)
it is not. If NESTED is true, we are inside a function or parsing it is not. If NESTED is true, we are inside a function or parsing
...@@ -2262,7 +2262,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser) ...@@ -2262,7 +2262,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
} }
/* Parse some declaration specifiers (possibly none) (C90 6.5, C99 /* Parse some declaration specifiers (possibly none) (C90 6.5, C99
6.7), adding them to SPECS (which may already include some). 6.7, C11 6.7), adding them to SPECS (which may already include some).
Storage class specifiers are accepted iff SCSPEC_OK; type Storage class specifiers are accepted iff SCSPEC_OK; type
specifiers are accepted iff TYPESPEC_OK; alignment specifiers are specifiers are accepted iff TYPESPEC_OK; alignment specifiers are
accepted iff ALIGNSPEC_OK; attributes are accepted at the start accepted iff ALIGNSPEC_OK; attributes are accepted at the start
...@@ -2279,7 +2279,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser) ...@@ -2279,7 +2279,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
handled as storage class specifiers, as is __thread. Alignment handled as storage class specifiers, as is __thread. Alignment
specifiers are from C11. specifiers are from C11.
C90 6.5.1, C99 6.7.1: C90 6.5.1, C99 6.7.1, C11 6.7.1:
storage-class-specifier: storage-class-specifier:
typedef typedef
extern extern
...@@ -2290,14 +2290,14 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser) ...@@ -2290,14 +2290,14 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
(_Thread_local is new in C11.) (_Thread_local is new in C11.)
C99 6.7.4: C99 6.7.4, C11 6.7.4:
function-specifier: function-specifier:
inline inline
_Noreturn _Noreturn
(_Noreturn is new in C11.) (_Noreturn is new in C11.)
C90 6.5.2, C99 6.7.2: C90 6.5.2, C99 6.7.2, C11 6.7.2:
type-specifier: type-specifier:
void void
char char
...@@ -2319,7 +2319,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser) ...@@ -2319,7 +2319,7 @@ c_parser_static_assert_declaration_no_semi (c_parser *parser)
(_Bool and _Complex are new in C99.) (_Bool and _Complex are new in C99.)
(atomic-type-specifier is new in C11.) (atomic-type-specifier is new in C11.)
C90 6.5.3, C99 6.7.3: C90 6.5.3, C99 6.7.3, C11 6.7.3:
type-qualifier: type-qualifier:
const const
...@@ -2656,7 +2656,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs, ...@@ -2656,7 +2656,7 @@ c_parser_declspecs (c_parser *parser, struct c_declspecs *specs,
out: ; out: ;
} }
/* Parse an enum specifier (C90 6.5.2.2, C99 6.7.2.2). /* Parse an enum specifier (C90 6.5.2.2, C99 6.7.2.2, C11 6.7.2.2).
enum-specifier: enum-specifier:
enum attributes[opt] identifier[opt] { enumerator-list } attributes[opt] enum attributes[opt] identifier[opt] { enumerator-list } attributes[opt]
...@@ -2819,7 +2819,7 @@ c_parser_enum_specifier (c_parser *parser) ...@@ -2819,7 +2819,7 @@ c_parser_enum_specifier (c_parser *parser)
return ret; return ret;
} }
/* Parse a struct or union specifier (C90 6.5.2.1, C99 6.7.2.1). /* Parse a struct or union specifier (C90 6.5.2.1, C99 6.7.2.1, C11 6.7.2.1).
struct-or-union-specifier: struct-or-union-specifier:
struct-or-union attributes[opt] identifier[opt] struct-or-union attributes[opt] identifier[opt]
...@@ -3014,8 +3014,8 @@ c_parser_struct_or_union_specifier (c_parser *parser) ...@@ -3014,8 +3014,8 @@ c_parser_struct_or_union_specifier (c_parser *parser)
return ret; return ret;
} }
/* Parse a struct-declaration (C90 6.5.2.1, C99 6.7.2.1), *without* /* Parse a struct-declaration (C90 6.5.2.1, C99 6.7.2.1, C11 6.7.2.1),
the trailing semicolon. *without* the trailing semicolon.
struct-declaration: struct-declaration:
specifier-qualifier-list struct-declarator-list specifier-qualifier-list struct-declarator-list
...@@ -3300,13 +3300,13 @@ c_parser_alignas_specifier (c_parser * parser) ...@@ -3300,13 +3300,13 @@ c_parser_alignas_specifier (c_parser * parser)
} }
/* Parse a declarator, possibly an abstract declarator (C90 6.5.4, /* Parse a declarator, possibly an abstract declarator (C90 6.5.4,
6.5.5, C99 6.7.5, 6.7.6). If TYPE_SEEN_P then a typedef name may 6.5.5, C99 6.7.5, 6.7.6, C11 6.7.6, 6.7.7). If TYPE_SEEN_P then
be redeclared; otherwise it may not. KIND indicates which kind of a typedef name may be redeclared; otherwise it may not. KIND
declarator is wanted. Returns a valid declarator except in the indicates which kind of declarator is wanted. Returns a valid
case of a syntax error in which case NULL is returned. *SEEN_ID is declarator except in the case of a syntax error in which case NULL is
set to true if an identifier being declared is seen; this is used returned. *SEEN_ID is set to true if an identifier being declared is
to diagnose bad forms of abstract array declarators and to seen; this is used to diagnose bad forms of abstract array declarators
determine whether an identifier list is syntactically permitted. and to determine whether an identifier list is syntactically permitted.
declarator: declarator:
pointer[opt] direct-declarator pointer[opt] direct-declarator
...@@ -4272,7 +4272,7 @@ c_parser_attributes (c_parser *parser) ...@@ -4272,7 +4272,7 @@ c_parser_attributes (c_parser *parser)
return attrs; return attrs;
} }
/* Parse a type name (C90 6.5.5, C99 6.7.6). /* Parse a type name (C90 6.5.5, C99 6.7.6, C11 6.7.7).
type-name: type-name:
specifier-qualifier-list abstract-declarator[opt] specifier-qualifier-list abstract-declarator[opt]
...@@ -4308,7 +4308,7 @@ c_parser_type_name (c_parser *parser) ...@@ -4308,7 +4308,7 @@ c_parser_type_name (c_parser *parser)
return ret; return ret;
} }
/* Parse an initializer (C90 6.5.7, C99 6.7.8). /* Parse an initializer (C90 6.5.7, C99 6.7.8, C11 6.7.9).
initializer: initializer:
assignment-expression assignment-expression
...@@ -4670,7 +4670,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after, ...@@ -4670,7 +4670,7 @@ c_parser_initval (c_parser *parser, struct c_expr *after,
} }
/* Parse a compound statement (possibly a function body) (C90 6.6.2, /* Parse a compound statement (possibly a function body) (C90 6.6.2,
C99 6.8.2). C99 6.8.2, C11 6.8.2).
compound-statement: compound-statement:
{ block-item-list[opt] } { block-item-list[opt] }
...@@ -4940,7 +4940,7 @@ c_parser_all_labels (c_parser *parser) ...@@ -4940,7 +4940,7 @@ c_parser_all_labels (c_parser *parser)
c_parser_label (parser); c_parser_label (parser);
} }
/* Parse a label (C90 6.6.1, C99 6.8.1). /* Parse a label (C90 6.6.1, C99 6.8.1, C11 6.8.1).
label: label:
identifier : attributes[opt] identifier : attributes[opt]
...@@ -5053,7 +5053,7 @@ c_parser_label (c_parser *parser) ...@@ -5053,7 +5053,7 @@ c_parser_label (c_parser *parser)
} }
} }
/* Parse a statement (C90 6.6, C99 6.8). /* Parse a statement (C90 6.6, C99 6.8, C11 6.8).
statement: statement:
labeled-statement labeled-statement
...@@ -5583,7 +5583,7 @@ c_parser_maybe_reclassify_token (c_parser *parser) ...@@ -5583,7 +5583,7 @@ c_parser_maybe_reclassify_token (c_parser *parser)
} }
} }
/* Parse an if statement (C90 6.6.4, C99 6.8.4). /* Parse an if statement (C90 6.6.4, C99 6.8.4, C11 6.8.4).
if-statement: if-statement:
if ( expression ) statement if ( expression ) statement
...@@ -5684,7 +5684,7 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain) ...@@ -5684,7 +5684,7 @@ c_parser_if_statement (c_parser *parser, bool *if_p, vec<tree> *chain)
c_parser_maybe_reclassify_token (parser); c_parser_maybe_reclassify_token (parser);
} }
/* Parse a switch statement (C90 6.6.4, C99 6.8.4). /* Parse a switch statement (C90 6.6.4, C99 6.8.4, C11 6.8.4).
switch-statement: switch-statement:
switch (expression) statement switch (expression) statement
...@@ -5741,7 +5741,7 @@ c_parser_switch_statement (c_parser *parser, bool *if_p) ...@@ -5741,7 +5741,7 @@ c_parser_switch_statement (c_parser *parser, bool *if_p)
c_parser_maybe_reclassify_token (parser); c_parser_maybe_reclassify_token (parser);
} }
/* Parse a while statement (C90 6.6.5, C99 6.8.5). /* Parse a while statement (C90 6.6.5, C99 6.8.5, C11 6.8.5).
while-statement: while-statement:
while (expression) statement while (expression) statement
...@@ -5791,7 +5791,7 @@ c_parser_while_statement (c_parser *parser, bool ivdep, bool *if_p) ...@@ -5791,7 +5791,7 @@ c_parser_while_statement (c_parser *parser, bool ivdep, bool *if_p)
c_cont_label = save_cont; c_cont_label = save_cont;
} }
/* Parse a do statement (C90 6.6.5, C99 6.8.5). /* Parse a do statement (C90 6.6.5, C99 6.8.5, C11 6.8.5).
do-statement: do-statement:
do statement while ( expression ) ; do statement while ( expression ) ;
...@@ -5835,7 +5835,7 @@ c_parser_do_statement (c_parser *parser, bool ivdep) ...@@ -5835,7 +5835,7 @@ c_parser_do_statement (c_parser *parser, bool ivdep)
add_stmt (c_end_compound_stmt (loc, block, flag_isoc99)); add_stmt (c_end_compound_stmt (loc, block, flag_isoc99));
} }
/* Parse a for statement (C90 6.6.5, C99 6.8.5). /* Parse a for statement (C90 6.6.5, C99 6.8.5, C11 6.8.5).
for-statement: for-statement:
for ( expression[opt] ; expression[opt] ; expression[opt] ) statement for ( expression[opt] ; expression[opt] ; expression[opt] ) statement
...@@ -6361,9 +6361,9 @@ c_parser_asm_goto_operands (c_parser *parser) ...@@ -6361,9 +6361,9 @@ c_parser_asm_goto_operands (c_parser *parser)
} }
/* Parse an expression other than a compound expression; that is, an /* Parse an expression other than a compound expression; that is, an
assignment expression (C90 6.3.16, C99 6.5.16). If AFTER is not assignment expression (C90 6.3.16, C99 6.5.16, C11 6.5.16). If
NULL then it is an Objective-C message expression which is the AFTER is not NULL then it is an Objective-C message expression which
primary-expression starting the expression as an initializer. is the primary-expression starting the expression as an initializer.
assignment-expression: assignment-expression:
conditional-expression conditional-expression
...@@ -6444,8 +6444,8 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after, ...@@ -6444,8 +6444,8 @@ c_parser_expr_no_commas (c_parser *parser, struct c_expr *after,
return ret; return ret;
} }
/* Parse a conditional expression (C90 6.3.15, C99 6.5.15). If AFTER /* Parse a conditional expression (C90 6.3.15, C99 6.5.15, C11 6.5.15). If
is not NULL then it is an Objective-C message expression which is AFTER is not NULL then it is an Objective-C message expression which is
the primary-expression starting the expression as an initializer. the primary-expression starting the expression as an initializer.
conditional-expression: conditional-expression:
...@@ -6558,9 +6558,9 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after, ...@@ -6558,9 +6558,9 @@ c_parser_conditional_expression (c_parser *parser, struct c_expr *after,
} }
/* Parse a binary expression; that is, a logical-OR-expression (C90 /* Parse a binary expression; that is, a logical-OR-expression (C90
6.3.5-6.3.14, C99 6.5.5-6.5.14). If AFTER is not NULL then it is 6.3.5-6.3.14, C99 6.5.5-6.5.14, C11 6.5.5-6.5.14). If AFTER is not
an Objective-C message expression which is the primary-expression NULL then it is an Objective-C message expression which is the
starting the expression as an initializer. primary-expression starting the expression as an initializer.
OMP_ATOMIC_LHS is NULL, unless parsing OpenMP #pragma omp atomic, OMP_ATOMIC_LHS is NULL, unless parsing OpenMP #pragma omp atomic,
when it should be the unfolded lhs. In a valid OpenMP source, when it should be the unfolded lhs. In a valid OpenMP source,
...@@ -6832,8 +6832,8 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after, ...@@ -6832,8 +6832,8 @@ c_parser_binary_expression (c_parser *parser, struct c_expr *after,
#undef POP #undef POP
} }
/* Parse a cast expression (C90 6.3.4, C99 6.5.4). If AFTER is not /* Parse a cast expression (C90 6.3.4, C99 6.5.4, C11 6.5.4). If AFTER
NULL then it is an Objective-C message expression which is the is not NULL then it is an Objective-C message expression which is the
primary-expression starting the expression as an initializer. primary-expression starting the expression as an initializer.
cast-expression: cast-expression:
...@@ -6893,7 +6893,7 @@ c_parser_cast_expression (c_parser *parser, struct c_expr *after) ...@@ -6893,7 +6893,7 @@ c_parser_cast_expression (c_parser *parser, struct c_expr *after)
return c_parser_unary_expression (parser); return c_parser_unary_expression (parser);
} }
/* Parse an unary expression (C90 6.3.3, C99 6.5.3). /* Parse an unary expression (C90 6.3.3, C99 6.5.3, C11 6.5.3).
unary-expression: unary-expression:
postfix-expression postfix-expression
...@@ -7493,7 +7493,8 @@ c_parser_generic_selection (c_parser *parser) ...@@ -7493,7 +7493,8 @@ c_parser_generic_selection (c_parser *parser)
return matched_assoc.expression; return matched_assoc.expression;
} }
/* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2). /* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2,
C11 6.5.1-6.5.2).
postfix-expression: postfix-expression:
primary-expression primary-expression
...@@ -8572,7 +8573,7 @@ c_parser_postfix_expression_after_primary (c_parser *parser, ...@@ -8572,7 +8573,7 @@ c_parser_postfix_expression_after_primary (c_parser *parser,
} }
} }
/* Parse an expression (C90 6.3.17, C99 6.5.17). /* Parse an expression (C90 6.3.17, C99 6.5.17, C11 6.5.17).
expression: expression:
assignment-expression assignment-expression
......
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