public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
@ 2003-08-24 18:01 ` pinskia at gcc dot gnu dot org
2004-11-11 12:37 ` lerdsuwa at gcc dot gnu dot org
` (4 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-24 18:01 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-24 18:01 -------
Seems like there should be a DR for this one since it looks like everyone is reading the
standard wrong, right?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
2003-08-24 18:01 ` [Bug c++/3332] friend function declaration in a class in a namespace causes error pinskia at gcc dot gnu dot org
@ 2004-11-11 12:37 ` lerdsuwa at gcc dot gnu dot org
2004-11-18 17:04 ` lerdsuwa at gcc dot gnu dot org
` (3 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-11-11 12:37 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-11-11 12:37 -------
Taking this bug. The code
void N::func(void)
is rejected because the declaration
friend void func(void);
doesn't declare 'func' inside namespace 'N'.
A separate declaration is necessary before the
qualified ID form 'N::func' can be used. The
following code, compiles under como, confirmed
the above idea.
namespace N
{
class A;
}
class N::A
{
void x();
friend void func(void);
};
namespace N
{
void func(void); // declare func
}
void N::func(void) // after declaration
// can now defined using qualified name
{
N::A a;
a.x(); // access private function
}
int main()
{
return 0;
}
The bug will be fixed when problematic codes in libjava
(it assumes friends are in '::') are corrected.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|nathan at gcc dot gnu dot |lerdsuwa at gcc dot gnu dot
|org |org
Status|SUSPENDED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
2003-08-24 18:01 ` [Bug c++/3332] friend function declaration in a class in a namespace causes error pinskia at gcc dot gnu dot org
2004-11-11 12:37 ` lerdsuwa at gcc dot gnu dot org
@ 2004-11-18 17:04 ` lerdsuwa at gcc dot gnu dot org
2004-11-25 17:06 ` lerdsuwa at gcc dot gnu dot org
` (2 subsequent siblings)
5 siblings, 0 replies; 6+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-11-18 17:04 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-11-18 17:04 -------
Patch submitted (both are required):
(Friend lookup part 2/n) http://gcc.gnu.org/ml/gcc-patches/2004-10/msg01372.html
(Friend lookup part 3/n) http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01495.html
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
` (3 preceding siblings ...)
2004-11-25 17:06 ` lerdsuwa at gcc dot gnu dot org
@ 2004-11-25 17:06 ` cvs-commit at gcc dot gnu dot org
2004-11-25 17:07 ` lerdsuwa at gcc dot gnu dot org
5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-25 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-11-25 17:05 -------
Subject: Bug 3332
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: lerdsuwa@gcc.gnu.org 2004-11-25 17:05:38
Modified files:
gcc/cp : ChangeLog name-lookup.c name-lookup.h parser.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/lookup: friend3.C friend4.C friend5.C
Log message:
Friend class name lookup 3/n, PR c++/3332
* name-lookup.c (push_inner_scope, pop_inner_scope): New functions.
(lookup_type_scope): Don't deal with name from user declaration
specially.
* name-lookup.h (push_inner_scope, pop_inner_scope): Add declarations.
* parser.c (cp_parser_class_specifier): Use push_inner_scope and
pop_inner_scope.
* g++.dg/lookup/friend3.C: New test.
* g++.dg/lookup/friend4.C: Likewise.
* g++.dg/lookup/friend5.C: Likewise.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4497&r2=1.4498
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.c.diff?cvsroot=gcc&r1=1.94&r2=1.95
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/name-lookup.h.diff?cvsroot=gcc&r1=1.31&r2=1.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.282&r2=1.283
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4647&r2=1.4648
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/friend3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/friend4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/friend5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
` (2 preceding siblings ...)
2004-11-18 17:04 ` lerdsuwa at gcc dot gnu dot org
@ 2004-11-25 17:06 ` lerdsuwa at gcc dot gnu dot org
2004-11-25 17:06 ` cvs-commit at gcc dot gnu dot org
2004-11-25 17:07 ` lerdsuwa at gcc dot gnu dot org
5 siblings, 0 replies; 6+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-11-25 17:06 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2004-11-25 17:06 -------
Fixed in the mainline by revised patch:
http://gcc.gnu.org/ml/gcc-patches/2004-11/msg02149.html
--
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/3332] friend function declaration in a class in a namespace causes error
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
` (4 preceding siblings ...)
2004-11-25 17:06 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-25 17:07 ` lerdsuwa at gcc dot gnu dot org
5 siblings, 0 replies; 6+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2004-11-25 17:07 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3332
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-11-25 17:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20010621084601.3332.aroach@stoic.electriceyeball.com>
2003-08-24 18:01 ` [Bug c++/3332] friend function declaration in a class in a namespace causes error pinskia at gcc dot gnu dot org
2004-11-11 12:37 ` lerdsuwa at gcc dot gnu dot org
2004-11-18 17:04 ` lerdsuwa at gcc dot gnu dot org
2004-11-25 17:06 ` lerdsuwa at gcc dot gnu dot org
2004-11-25 17:06 ` cvs-commit at gcc dot gnu dot org
2004-11-25 17:07 ` lerdsuwa at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).