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
82be290b
Commit
82be290b
authored
Jan 29, 2018
by
Jason Merrill
Committed by
Jason Merrill
Jan 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PR c++/83942 - wrong unused warning with static_cast.
* cvt.c (ocp_convert): Call mark_rvalue_use. From-SVN: r257155
parent
b9921bf0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
gcc/cp/ChangeLog
+5
-0
gcc/cp/cvt.c
+3
-0
gcc/testsuite/g++.dg/warn/Wunused-var30.C
+9
-0
No files found.
gcc/cp/ChangeLog
View file @
82be290b
2018-01-29 Jason Merrill <jason@redhat.com>
PR c++/83942 - wrong unused warning with static_cast.
* cvt.c (ocp_convert): Call mark_rvalue_use.
2018-01-26 Jason Merrill <jason@redhat.com>
PR c++/83956 - wrong dtor error with anonymous union
...
...
gcc/cp/cvt.c
View file @
82be290b
...
...
@@ -691,7 +691,10 @@ ocp_convert (tree type, tree expr, int convtype, int flags,
/* FIXME remove when moving to c_fully_fold model. */
if
(
!
CLASS_TYPE_P
(
type
))
{
e
=
mark_rvalue_use
(
e
);
e
=
scalar_constant_value
(
e
);
}
if
(
error_operand_p
(
e
))
return
error_mark_node
;
...
...
gcc/testsuite/g++.dg/warn/Wunused-var30.C
0 → 100644
View file @
82be290b
// PR c++/83942
// { dg-do compile { target c++11 } }
// { dg-additional-options "-Wall" }
enum
class
E
{
E1
};
int
main
()
{
E
const
e
=
E
::
E1
;
return
static_cast
<
int
>
(
e
);
}
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