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
c4ce224c
Commit
c4ce224c
authored
Dec 05, 2011
by
Jason Merrill
Committed by
Jason Merrill
Dec 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* init.c (expand_default_init): Unshare args in ctor delegation.
From-SVN: r182013
parent
238e471c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
7 deletions
+68
-7
gcc/cp/ChangeLog
+4
-0
gcc/cp/init.c
+20
-7
gcc/testsuite/ChangeLog
+4
-0
gcc/testsuite/g++.dg/cpp0x/dc6.C
+40
-0
No files found.
gcc/cp/ChangeLog
View file @
c4ce224c
2011-12-05 Jason Merrill <jason@redhat.com>
* init.c (expand_default_init): Unshare args in ctor delegation.
2011-12-05 Ville Voutilainen <ville.voutilainen@gmail.com>
Pedro Lamarão <pedro.lamarao@gmail.com>
...
...
gcc/cp/init.c
View file @
c4ce224c
...
...
@@ -1619,17 +1619,30 @@ expand_default_init (tree binfo, tree true_exp, tree exp, tree init, int flags,
/* Delegating constructor. */
tree
complete
;
tree
base
;
tree
elt
;
unsigned
i
;
/* Unshare the arguments for the second call. */
VEC
(
tree
,
gc
)
*
parms2
=
make_tree_vector
();
FOR_EACH_VEC_ELT
(
tree
,
parms
,
i
,
elt
)
{
elt
=
break_out_target_exprs
(
elt
);
VEC_safe_push
(
tree
,
gc
,
parms2
,
elt
);
}
complete
=
build_special_member_call
(
exp
,
complete_ctor_identifier
,
&
parms
,
binfo
,
flags
,
complain
);
&
parms2
,
binfo
,
flags
,
complain
);
complete
=
fold_build_cleanup_point_expr
(
void_type_node
,
complete
);
release_tree_vector
(
parms2
);
base
=
build_special_member_call
(
exp
,
base_ctor_identifier
,
&
parms
,
binfo
,
flags
,
complain
);
rval
=
build3
(
COND_EXPR
,
TREE_TYPE
(
complete
),
build2
(
EQ_EXPR
,
boolean_type_node
,
current_in_charge_parm
,
integer_zero_node
),
base
,
complete
);
base
=
fold_build_cleanup_point_expr
(
void_type_node
,
base
);
rval
=
build3
(
COND_EXPR
,
void_type_node
,
build2
(
EQ_EXPR
,
boolean_type_node
,
current_in_charge_parm
,
integer_zero_node
),
base
,
complete
);
}
else
{
...
...
gcc/testsuite/ChangeLog
View file @
c4ce224c
2011-12-05 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/dc6.C: New.
2011-12-05 Ville Voutilainen <ville.voutilainen@gmail.com>
Pedro Lamarão <pedro.lamarao@gmail.com>
...
...
gcc/testsuite/g++.dg/cpp0x/dc6.C
0 → 100644
View file @
c4ce224c
// { dg-do run { target c++11 } }
int
a_ct
;
struct
A
{
A
(
int
i
)
:
i
(
i
)
{
++
a_ct
;
}
A
(
const
A
&
a
)
:
i
(
a
.
i
)
{
++
a_ct
;
}
~
A
()
{
--
a_ct
;
}
int
i
;
};
struct
V
{
V
()
{
}
};
struct
B
:
virtual
V
{
A
a
;
B
(
A
a
)
:
a
(
a
)
{
}
B
(
int
i
)
:
B
(
A
(
i
))
{
}
};
struct
C
:
B
{
C
(
int
i
)
:
B
(
i
)
{
}
};
int
main
()
{
{
B
b
(
42
);
C
c
(
24
);
if
(
b
.
a
.
i
!=
42
||
c
.
a
.
i
!=
24
)
__builtin_abort
();
}
return
a_ct
;
}
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