This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15453] Friend declaration treated as a declaration in scope.
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 May 2004 09:46:32 -0000
- Subject: [Bug c++/15453] Friend declaration treated as a declaration in scope.
- References: <20040515033804.15453.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-05-15 09:46 -------
No, the problem is the opposite. The standard says that a friend declaration
does not introduce the name into the scope in which it is declared
([basic.scope]/3). So, if we have a bug here, is that we accept the non-
template case:
---------------------------
class A
{
friend class O;
O* o;
};
---------------------------
This should be rejected but it is accepted by GCC. I keep this as the bug
tracked in this report.
BTW, latest EDG agrees with my interpretation, so either Andrew is using an old
ICC, or he hasn't activated strict ansi mode.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at libero dot
| |it
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2004-05-15 09:46:30
date| |
Summary|Friend declaration not |Friend declaration treated
|treated as a declaration in |as a declaration in scope.
|scope. |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15453