From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26548 invoked by alias); 28 Mar 2013 07:05:30 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26495 invoked by uid 48); 28 Mar 2013 07:05:23 -0000 From: "erik.thiele@thiele-hydraulik.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/56760] namespaces, templates and forwarding declarations. Date: Thu, 28 Mar 2013 07:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: erik.thiele@thiele-hydraulik.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-03/txt/msg02066.txt.bz2 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::contain > const&, nam::binbuffer&)': v1.cpp:(.text._Z4funcIN4seco6holderIiEEEvRKNS0_7containIT_EERN3nam9binbufferE[_Z4funcIN4seco6holderIiEEEvRKNS0_7containIT_EERN3nam9binbufferE]+0x16): undefined reference to `void func >(seco::holder 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.