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
793fbf0b
Commit
793fbf0b
authored
Jun 09, 2011
by
Jason Merrill
Committed by
Jason Merrill
Jun 09, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* semantics.c (maybe_constant_value): Handle overflowed input.
From-SVN: r174885
parent
377a5364
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
3 deletions
+17
-3
gcc/cp/ChangeLog
+3
-0
gcc/cp/semantics.c
+10
-2
libstdc++-v3/ChangeLog
+2
-0
libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc
+2
-1
No files found.
gcc/cp/ChangeLog
View file @
793fbf0b
2011-06-09 Jason Merrill <jason@redhat.com>
* semantics.c (maybe_constant_value): Handle overflowed input.
(non_const_var_error): Handle non-constant DECL_INITIAL.
* pt.c (build_non_dependent_expr): Use fold_non_dependent_expr_sfinae.
* parser.c (cp_parser_constant_expression): Just return the
...
...
gcc/cp/semantics.c
View file @
793fbf0b
...
...
@@ -6902,7 +6902,8 @@ non_const_var_error (tree r)
else
if
(
CP_TYPE_VOLATILE_P
(
type
))
inform
(
DECL_SOURCE_LOCATION
(
r
),
"%q#D is volatile"
,
r
);
else
if
(
!
DECL_INITIAL
(
r
))
else
if
(
!
DECL_INITIAL
(
r
)
||
!
TREE_CONSTANT
(
DECL_INITIAL
(
r
)))
inform
(
DECL_SOURCE_LOCATION
(
r
),
"%qD was not initialized with a constant "
"expression"
,
r
);
...
...
@@ -7337,7 +7338,14 @@ maybe_constant_value (tree t)
||
type_unknown_p
(
t
)
||
!
potential_constant_expression
(
t
)
||
value_dependent_expression_p
(
t
))
return
t
;
{
if
(
TREE_OVERFLOW_P
(
t
))
{
t
=
build_nop
(
TREE_TYPE
(
t
),
t
);
TREE_CONSTANT
(
t
)
=
false
;
}
return
t
;
}
r
=
cxx_eval_outermost_constant_expr
(
t
,
true
);
#ifdef ENABLE_CHECKING
...
...
libstdc++-v3/ChangeLog
View file @
793fbf0b
2011-06-09 Jason Merrill <jason@redhat.com>
* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust.
* testsuite/lib/prune.exp (libstdc++-dg-prune): Prune notes.
* testsuite/20_util/duration/cons/1_neg.cc: Remove dg-excess-errors.
* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
...
...
libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc
View file @
793fbf0b
...
...
@@ -51,4 +51,5 @@ test04()
// { dg-error "required from here" "" { target *-*-* } 46 }
// { dg-error "denominator cannot be zero" "" { target *-*-* } 268 }
// { dg-error "out of range" "" { target *-*-* } 269 }
// { dg-error "overflow in constant expression" "" { target *-*-* } 109 }
// { dg-error "overflow in constant expression" "" { target *-*-* } 61 }
// { dg-prune-output "not a member" }
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