From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28841 invoked by alias); 12 Nov 2002 19:36:09 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 28673 invoked by uid 71); 12 Nov 2002 19:36:06 -0000 Date: Tue, 19 Nov 2002 18:08:00 -0000 Message-ID: <20021112193606.28666.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Gabriel Dos Reis Subject: Re: libstdc++/8550: undefined reference to fill and fill_n Reply-To: Gabriel Dos Reis X-SW-Source: 2002-11/txt/msg00601.txt.bz2 List-Id: The following reply was made to PR libstdc++/8550; it has been noted by GNATS. From: Gabriel Dos Reis To: "Brian T. N. Gunney" Cc: gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/8550: undefined reference to fill and fill_n Date: 12 Nov 2002 20:36:13 +0100 "Brian T. N. Gunney" writes: | >State: open | >Class: sw-bug This is user confusion. [...] | The fill and fill_n functions are missing when compiled with -fno-implicit-template, | leading to an error at link time. Which matches the documented behaviour. | | This is similar to bug 8172, in which I reported a missing operator+ for strings. | >How-To-Repeat: | | Program text: | #include | using namespace std; | int main() { | double x[10]; | fill_n( x, 10, 1.0 ); | fill( x, x+10, 2.0 ); | return 0; | } | | Compile command: | g++ -fno-implicit-templates nofill.cc The above tells g++ not to implicitly instantiate the required definitions. Which means you *ought* to manually provide them -- usually through explicit instantiation. The simple way fo fix this is: don't do that. -- Gaby