c++/10694: [3.3/3.4 regression] Befriending a function in a class that is only forward-declared

Steven Bosscher s.bosscher@student.tudelft.nl
Sun May 11 11:16:00 GMT 2003


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10694

: Search converges between 2003-03-10-trunk (#149) and 2003-03-11-trunk 
(#150).

Line-numbered input is:
========================================
     1  template <class T> struct Y;
     2    
     3  template <class S> class X {
     4      template <class T> friend void Y<T>::member();
     5  };
     6    
     7  template <class T> struct Y {
     8      void member() {
     9        X<int>();
    10      }
    11  };
    12    
    13  template class Y<int>;
    14 

========================================


Diagnostic output follows, from the last compiler tested:
input: In instantiation of `X<int>':
input:9:   instantiated from `void Y<T>::member() [with T = int]'
input:13:   instantiated from here
input:4: error: prototype for `template<class T> void Y::member()' does not
   match any in class `Y<T>'
input:8: error: candidate is: void Y<T>::member()

Compiler output follows, from the last compiler tested:
        .file   "input"
        .ident  "GCC: (GNU) 3.4 20030311 (experimental)"




More information about the Gcc-bugs mailing list