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++/56760] namespaces, templates and forwarding declarations.


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.


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