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]

namespace + template friend = nasty shadow


To my knowledge the code below is legal.  Bug report follows.

 -petter.


-------------------$ uname -a
Linux katsumoto.matfys.lth.se 2.0.34 #1 Fri May 8 16:05:57 EDT 1998 i586
unknown

-------------------$ g++ -v
Reading specs from
/usr/local/lib/gcc-lib/i586-pc-linux-gnu/egcs-2.91.56/specs
gcc version egcs-2.91.56 19980829 (egcs-1.1 pre-release)

-------------------$ g++ nsbug.cc
nsbug.cc: In function `int main()':
nsbug.cc:14: no matching function for call to `func (int)'

-------------------$ cat nsbug.cc
void func(int) {}

namespace ns {
    template< typename T > class umeo {
 	template< typename U >
	  friend void func(const umeo<U>& x) {}
    };
}

using namespace ns;

main() {
    umeo< double > aaa;
    func(10);
}


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