This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15453] Friend declaration treated as a declaration in scope.


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]