This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
namespace + template friend = nasty shadow
- To: egcs-bugs at cygnus dot com
- Subject: namespace + template friend = nasty shadow
- From: Petter Urkedal <petter at matfys dot lth dot se>
- Date: Thu, 03 Sep 1998 16:13:23 +0200
- Organization: Lund Institute of Technology
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);
}