Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
98ce043b
Commit
98ce043b
authored
Jan 30, 2004
by
Michael Matz
Committed by
Michael Matz
Jan 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* parser.c (cp_parser_labeled_statement): Accept case ranges.
From-SVN: r76972
parent
d0acf599
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
3 deletions
+29
-3
gcc/cp/ChangeLog
+4
-0
gcc/cp/parser.c
+25
-3
No files found.
gcc/cp/ChangeLog
View file @
98ce043b
2004-01-30 Michael Matz <matz@suse.de>
* parser.c (cp_parser_labeled_statement): Accept case ranges.
2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
DR206
...
...
gcc/cp/parser.c
View file @
98ce043b
...
...
@@ -5472,7 +5472,12 @@ cp_parser_statement (cp_parser* parser, bool in_statement_expr_p)
labeled-statement:
identifier : statement
case constant-expression : statement
default : statement
default : statement
GNU Extension:
labeled-statement:
case constant-expression ... constant-expression : statement
Returns the new CASE_LABEL, for a `case' or `default' label. For
an ordinary label, returns a LABEL_STMT. */
...
...
@@ -5496,7 +5501,8 @@ cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p)
{
case
RID_CASE
:
{
tree
expr
;
tree
expr
,
expr_hi
;
cp_token
*
ellipsis
;
/* Consume the `case' token. */
cp_lexer_consume_token
(
parser
->
lexer
);
...
...
@@ -5504,10 +5510,26 @@ cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p)
expr
=
cp_parser_constant_expression
(
parser
,
/*allow_non_constant_p=*/
false
,
NULL
);
ellipsis
=
cp_lexer_peek_token
(
parser
->
lexer
);
if
(
ellipsis
->
type
==
CPP_ELLIPSIS
)
{
/* Consume the `...' token. */
cp_lexer_consume_token
(
parser
->
lexer
);
expr_hi
=
cp_parser_constant_expression
(
parser
,
/*allow_non_constant_p=*/
false
,
NULL
);
/* We don't need to emit warnings here, as the common code
will do this for us. */
}
else
expr_hi
=
NULL_TREE
;
if
(
!
parser
->
in_switch_statement_p
)
error
(
"case label `%E' not within a switch statement"
,
expr
);
else
statement
=
finish_case_label
(
expr
,
NULL_TREE
);
statement
=
finish_case_label
(
expr
,
expr_hi
);
}
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment