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
f3be9e3c
Commit
f3be9e3c
authored
Aug 25, 1995
by
Per Bothner
Committed by
Richard Kenner
Aug 25, 1995
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(do_identifier): Handle old (non-ANSI) for scoping, and warn if
conflicts. From-SVN: r10275
parent
d2ad151f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
gcc/cp/lex.c
+35
-0
No files found.
gcc/cp/lex.c
View file @
f3be9e3c
...
@@ -2916,6 +2916,41 @@ do_identifier (token)
...
@@ -2916,6 +2916,41 @@ do_identifier (token)
SET_IDENTIFIER_ERROR_LOCUS
(
token
,
current_function_decl
);
SET_IDENTIFIER_ERROR_LOCUS
(
token
,
current_function_decl
);
}
}
}
}
if
(
TREE_CODE
(
id
)
==
VAR_DECL
&&
DECL_DEAD_FOR_LOCAL
(
id
))
{
tree
shadowed
=
DECL_SHADOWED_FOR_VAR
(
id
);
if
(
shadowed
)
{
if
(
!
DECL_ERROR_REPORTED
(
id
))
{
warning
(
"name lookup of `%s' changed"
,
IDENTIFIER_POINTER
(
token
));
cp_warning_at
(
" matches this `%D' under current ANSI rules"
,
shadowed
);
cp_warning_at
(
" matches this `%D' under old rules"
,
id
);
DECL_ERROR_REPORTED
(
id
)
=
1
;
}
id
=
shadowed
;
}
else
if
(
!
DECL_ERROR_REPORTED
(
id
))
{
static
char
msg
[]
=
"name lookup of `%s' changed for new ANSI `for' scoping"
;
DECL_ERROR_REPORTED
(
id
)
=
1
;
if
(
TYPE_NEEDS_DESTRUCTOR
(
TREE_TYPE
(
id
)))
{
error
(
msg
,
IDENTIFIER_POINTER
(
token
));
cp_error_at
(
" cannot use obsolete binding at `%D' because it has a destructor"
,
id
);
id
=
error_mark_node
;
}
else
{
pedwarn
(
msg
,
IDENTIFIER_POINTER
(
token
));
cp_pedwarn_at
(
" using obsolete binding at `%D'"
,
id
);
}
}
}
/* TREE_USED is set in `hack_identifier'. */
/* TREE_USED is set in `hack_identifier'. */
if
(
TREE_CODE
(
id
)
==
CONST_DECL
)
if
(
TREE_CODE
(
id
)
==
CONST_DECL
)
{
{
...
...
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