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
e252e96a
Commit
e252e96a
authored
Nov 19, 2012
by
Jason Merrill
Committed by
Jason Merrill
Nov 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* class.c (one_inheriting_sig): Don't inherit base copy ctors.
From-SVN: r193623
parent
61d1b821
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
gcc/cp/ChangeLog
+2
-0
gcc/cp/class.c
+11
-7
gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
+15
-0
No files found.
gcc/cp/ChangeLog
View file @
e252e96a
2012-11-19 Jason Merrill <jason@redhat.com>
* class.c (one_inheriting_sig): Don't inherit base copy ctors.
PR c++/55262
* method.c (implicitly_declare_fn): Set DECL_PARM_INDEX on
the parms of an inheriting ctor.
...
...
gcc/cp/class.c
View file @
e252e96a
...
...
@@ -2886,15 +2886,19 @@ static void
one_inheriting_sig
(
tree
t
,
tree
ctor
,
tree
*
parms
,
int
nparms
)
{
/* We don't declare an inheriting ctor that would be a default,
copy or move ctor. */
if
(
nparms
==
0
||
(
nparms
==
1
&&
TREE_CODE
(
parms
[
0
])
==
REFERENCE_TYPE
&&
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
parms
[
0
]))
==
t
))
copy or move ctor for derived or base. */
if
(
nparms
==
0
)
return
;
int
i
;
if
(
nparms
==
1
&&
TREE_CODE
(
parms
[
0
])
==
REFERENCE_TYPE
)
{
tree
parm
=
TYPE_MAIN_VARIANT
(
TREE_TYPE
(
parms
[
0
]));
if
(
parm
==
t
||
parm
==
DECL_CONTEXT
(
ctor
))
return
;
}
tree
parmlist
=
void_list_node
;
for
(
i
=
nparms
-
1
;
i
>=
0
;
i
--
)
for
(
i
nt
i
=
nparms
-
1
;
i
>=
0
;
i
--
)
parmlist
=
tree_cons
(
NULL_TREE
,
parms
[
i
],
parmlist
);
tree
fn
=
implicitly_declare_fn
(
sfk_inheriting_constructor
,
t
,
false
,
ctor
,
parmlist
);
...
...
gcc/testsuite/g++.dg/cpp0x/inh-ctor15.C
0 → 100644
View file @
e252e96a
// Discussions on the core reflector indicate that not inheriting base copy
// constructors was a deliberate choice.
// { dg-options -std=c++11 }
struct
A
{
A
(
int
);
};
struct
B
:
public
A
{
using
A
::
A
;
};
A
a
(
42
);
B
b1
(
24
);
// inherited
B
b2
(
a
);
// not inherited { dg-error "no match" }
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