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
13f649f6
Commit
13f649f6
authored
Dec 17, 2014
by
Jason Merrill
Committed by
Jason Merrill
Dec 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* constexpr.c: Tweak comments and formatting.
From-SVN: r218830
parent
43a39cdd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
gcc/cp/ChangeLog
+4
-0
gcc/cp/constexpr.c
+13
-7
No files found.
gcc/cp/ChangeLog
View file @
13f649f6
2014-12-17 Jason Merrill <jason@redhat.com>
* constexpr.c: Tweak comments and formatting.
2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58650
...
...
gcc/cp/constexpr.c
View file @
13f649f6
/* Perform the semantic phase of constexpr parsing, i.e., the process of
building tree structure, checking semantic consistency, and
building RTL. These routines are used both during actual parsing
/* Perform -*- C++ -*- constant expression evaluation, including calls to
constexpr functions. These routines are used both during actual parsing
and during the instantiation of template functions.
Copyright (C) 1998-2014 Free Software Foundation, Inc.
...
...
@@ -866,11 +865,20 @@ struct constexpr_call_hasher : ggc_hasher<constexpr_call *>
is a map of values of variables initialized within the expression. */
struct
constexpr_ctx
{
/* The innermost call we're evaluating. */
constexpr_call
*
call
;
/* Values for any temporaries or local variables within the
constant-expression. */
hash_map
<
tree
,
tree
>
*
values
;
/* The CONSTRUCTOR we're currently building up for an aggregate
initializer. */
tree
ctor
;
/* The object we're building the CONSTRUCTOR for. */
tree
object
;
/* Whether we should error on a non-constant expression or fail quietly. */
bool
quiet
;
/* Whether we are strictly conforming to constant expression rules or
trying harder to get a constant value. */
bool
strict
;
};
...
...
@@ -3428,9 +3436,8 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
{
bool
non_constant_p
=
false
;
bool
overflow_p
=
false
;
constexpr_ctx
ctx
=
{
NULL
,
NULL
,
NULL
,
NULL
,
allow_non_constant
,
strict
};
hash_map
<
tree
,
tree
>
map
;
c
tx
.
values
=
&
map
;
c
onstexpr_ctx
ctx
=
{
NULL
,
&
map
,
NULL
,
NULL
,
allow_non_constant
,
strict
}
;
tree
type
=
initialized_type
(
t
);
tree
r
=
t
;
if
(
AGGREGATE_TYPE_P
(
type
)
||
VECTOR_TYPE_P
(
type
))
...
...
@@ -3537,9 +3544,8 @@ is_sub_constant_expr (tree t)
{
bool
non_constant_p
=
false
;
bool
overflow_p
=
false
;
constexpr_ctx
ctx
=
{
NULL
,
NULL
,
NULL
,
NULL
,
true
,
true
};
hash_map
<
tree
,
tree
>
map
;
c
tx
.
values
=
&
map
;
c
onstexpr_ctx
ctx
=
{
NULL
,
&
map
,
NULL
,
NULL
,
true
,
true
}
;
cxx_eval_constant_expression
(
&
ctx
,
t
,
false
,
&
non_constant_p
,
&
overflow_p
);
return
!
non_constant_p
&&
!
overflow_p
;
...
...
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