This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56760] namespaces, templates and forwarding declarations.
- From: "erik dot thiele at thiele-hydraulik dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 28 Mar 2013 07:05:22 +0000
- Subject: [Bug c++/56760] namespaces, templates and forwarding declarations.
- Auto-submitted: auto-generated
- References: <bug-56760-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56760
--- Comment #2 from erik.thiele@thiele-hydraulik.de 2013-03-28 07:05:22 UTC ---
You see attached two files. v1.cpp and v2.cpp
g++ --version
g++ (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ -Wall v1.cpp
/tmp/ccZAyNEb.o: In function `void func<seco::holder<int>
>(seco::contain<seco::holder<int> > const&, nam::binbuffer&)':
v1.cpp:(.text._Z4funcIN4seco6holderIiEEEvRKNS0_7containIT_EERN3nam9binbufferE[_Z4funcIN4seco6holderIiEEEvRKNS0_7containIT_EERN3nam9binbufferE]+0x16):
undefined reference to `void func<seco::holder<int> >(seco::holder<int> const&,
nam::binbuffer&)'
collect2: error: ld returned 1 exit status
g++ -Wall v2.cpp
--> no errors
in v1.cpp you see a commented out line with a template forward declaration. if
you comment that in:
g++ -Wall v1.cpp
--> no errors
The only difference between v1 and v2 is that in v2 you do not have the "nam"
namespace.