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
062ed875
Commit
062ed875
authored
Aug 20, 2015
by
Jason Merrill
Committed by
Jason Merrill
Aug 20, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* name-lookup.c (hidden_name_p): Handle OVERLOAD.
From-SVN: r227044
parent
4ba1fef2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
6 deletions
+43
-6
gcc/cp/ChangeLog
+4
-0
gcc/cp/name-lookup.c
+7
-0
gcc/testsuite/g++.dg/lookup/friend16.C
+24
-0
gcc/testsuite/g++.dg/template/friend15.C
+3
-2
gcc/testsuite/g++.dg/template/friend18.C
+3
-2
gcc/testsuite/g++.old-deja/g++.pt/friend32.C
+2
-2
No files found.
gcc/cp/ChangeLog
View file @
062ed875
2015-08-20 Jason Merrill <jason@redhat.com>
* name-lookup.c (hidden_name_p): Handle OVERLOAD.
2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
2015-08-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/67065
PR c++/67065
...
...
gcc/cp/name-lookup.c
View file @
062ed875
...
@@ -4346,6 +4346,13 @@ hidden_name_p (tree val)
...
@@ -4346,6 +4346,13 @@ hidden_name_p (tree val)
&&
TYPE_FUNCTION_OR_TEMPLATE_DECL_P
(
val
)
&&
TYPE_FUNCTION_OR_TEMPLATE_DECL_P
(
val
)
&&
DECL_ANTICIPATED
(
val
))
&&
DECL_ANTICIPATED
(
val
))
return
true
;
return
true
;
if
(
TREE_CODE
(
val
)
==
OVERLOAD
)
{
for
(
tree
o
=
val
;
o
;
o
=
OVL_CHAIN
(
o
))
if
(
!
hidden_name_p
(
OVL_FUNCTION
(
o
)))
return
false
;
return
true
;
}
return
false
;
return
false
;
}
}
...
...
gcc/testsuite/g++.dg/lookup/friend16.C
0 → 100644
View file @
062ed875
namespace
std
{
class
ostream
;
}
namespace
N2
{
class
C0
{};
}
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os_
,
const
N2
::
C0
&
m_
);
namespace
N1
{
class
C1
{
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
C1
&
what
);
};
class
C2
{
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
C2
&
what
);
};
void
foo
(
std
::
ostream
&
os
,
const
N2
::
C0
&
m
)
{
os
<<
m
;
// Is this line valid?
}
}
gcc/testsuite/g++.dg/template/friend15.C
View file @
062ed875
...
@@ -10,10 +10,11 @@ template <typename> class X {
...
@@ -10,10 +10,11 @@ template <typename> class X {
struct
Inner
;
struct
Inner
;
template
<
typename
R
>
template
<
typename
R
>
friend
typename
X
<
R
>::
Inner
*
foo
()
{
return
0
;
}
friend
typename
X
<
R
>::
Inner
*
foo
(
X
<
R
>*
)
{
return
0
;
}
};
};
template
class
X
<
void
>
;
template
class
X
<
void
>
;
X
<
void
>*
p
;
struct
U
{
struct
U
{
void
bar
()
{
foo
<
void
>
(
);
}
void
bar
()
{
foo
(
p
);
}
};
};
gcc/testsuite/g++.dg/template/friend18.C
View file @
062ed875
...
@@ -7,13 +7,14 @@
...
@@ -7,13 +7,14 @@
template
<
int
N
>
struct
X
template
<
int
N
>
struct
X
{
{
template
<
int
M
>
friend
int
foo
(
X
const
&
)
template
<
int
M
>
friend
int
foo
(
X
const
&
,
X
<
M
>
const
&
)
{
{
return
N
*
10000
+
M
;
return
N
*
10000
+
M
;
}
}
};
};
X
<
1234
>
bring
;
X
<
1234
>
bring
;
X
<
5678
>
brung
;
int
main
()
{
int
main
()
{
return
foo
<
5678
>
(
bri
ng
)
!=
12345678
;
return
foo
(
bring
,
bru
ng
)
!=
12345678
;
}
}
gcc/testsuite/g++.old-deja/g++.pt/friend32.C
View file @
062ed875
...
@@ -7,8 +7,8 @@ struct S {
...
@@ -7,8 +7,8 @@ struct S {
};
};
template
class
S
<
int
,
double
>
;
template
class
S
<
int
,
double
>
;
template
char
f
(
char
,
long
,
short
);
template
char
f
(
char
,
long
,
short
);
// { dg-error "f" }
template
char
*
f
(
char
*
,
long
*
,
short
*
);
template
char
*
f
(
char
*
,
long
*
,
short
*
);
// { dg-error "f" }
template
<
class
X
,
class
Y
,
class
Z
>
template
<
class
X
,
class
Y
,
class
Z
>
X
f
(
X
x
,
Y
,
Z
)
{
X
f
(
X
x
,
Y
,
Z
)
{
...
...
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