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
7c92f4ec
Commit
7c92f4ec
authored
Oct 27, 2016
by
Jason Merrill
Committed by
Jason Merrill
Oct 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* class.c (add_method): Allow using-declarations to coexist.
From-SVN: r241620
parent
104700f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
gcc/cp/ChangeLog
+4
-0
gcc/cp/class.c
+5
-0
gcc/testsuite/g++.dg/overload/using4.C
+19
-0
No files found.
gcc/cp/ChangeLog
View file @
7c92f4ec
2016-10-26 Jason Merrill <jason@redhat.com>
* class.c (add_method): Allow using-declarations to coexist.
2016-10-25 Jason Merrill <jason@redhat.com>
2016-10-25 Jason Merrill <jason@redhat.com>
* constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.
* constexpr.c (maybe_constant_init): Pull out TARGET_EXPR_INITIAL.
...
...
gcc/cp/class.c
View file @
7c92f4ec
...
@@ -1094,6 +1094,11 @@ add_method (tree type, tree method, tree using_decl)
...
@@ -1094,6 +1094,11 @@ add_method (tree type, tree method, tree using_decl)
if
(
TREE_CODE
(
fn
)
!=
TREE_CODE
(
method
))
if
(
TREE_CODE
(
fn
)
!=
TREE_CODE
(
method
))
continue
;
continue
;
/* Two using-declarations can coexist, we'll complain about ambiguity in
overload resolution. */
if
(
using_decl
&&
TREE_CODE
(
fns
)
==
OVERLOAD
&&
OVL_USED
(
fns
))
continue
;
/* [over.load] Member function declarations with the
/* [over.load] Member function declarations with the
same name and the same parameter types cannot be
same name and the same parameter types cannot be
overloaded if any of them is a static member
overloaded if any of them is a static member
...
...
gcc/testsuite/g++.dg/overload/using4.C
0 → 100644
View file @
7c92f4ec
struct
A
{
void
f
();
};
struct
B
{
void
f
();
};
struct
C
:
A
,
B
{
using
A
::
f
;
using
B
::
f
;
};
int
main
()
{
C
().
f
();
// { dg-error "ambiguous" }
}
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