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++/14513] Friend name injection problem (implicit declaration)


------- Additional Comments From bangerth at dealii dot org  2004-03-10 16:24 -------
OK, so here's what happens:  
------------  
struct S {  
    void test (void);  
};  
  
namespace NS {  
  class X {  
      friend class S;  
      static int *i;  
  };  
}  
  
void S::test () {  
  NS::X::i;  
}  
---------------  
gcc thinks the 'friend class S' declaration refers to class ::S and thus  
allows the access in S::test. All the other compilers seem to believe  
that the friend declaration refer to a yet-to-be-declared class NS::S,  
and therefore don't allow access in ::S::test. I have yet to understand  
what the standard really says in this respect. Kriang?  
  
W.  

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lerdsuwa at gcc dot gnu dot
                   |                            |org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14513


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