From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8838 invoked by alias); 21 Oct 2004 03:49:59 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8817 invoked by alias); 21 Oct 2004 03:49:58 -0000 Date: Thu, 21 Oct 2004 03:49:00 -0000 Message-ID: <20041021034958.8816.qmail@sourceware.org> From: "ramya dot chandar at wipro dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20041019091955.18055.ramya.chandar@wipro.com> References: <20041019091955.18055.ramya.chandar@wipro.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/18055] seems not possible to specialize a template member function X-Bugzilla-Reason: CC X-SW-Source: 2004-10/txt/msg02739.txt.bz2 List-Id: ------- Additional Comments From ramya dot chandar at wipro dot com 2004-10-21 03:49 ------- Subject: Re: seems not possible to specialize a template member function I tried the way you have mentioned. Giving the "template<> " in all the specialized function definitions. But, it didn't work out. I tried changing the compiler options too. 1) Compiling the template using code with -frepo. The compiler will generate files with the extension .rpo listing all of the template instantiations used in the corresponding object files which could be instantiated there. This also didn't work. According to the below given info, 2) In the single source file where the full implementation belongs, you can use either a naming convention or #pragma implementation to indicate this alternate use of the header file. But, it is of no use. 3) when you include the same header file in a main source file that declares it as #pragma implementation, the compiler emits code for the function itself; If all calls to the function can be inlined, you can avoid emitting the function by compiling with -fno-implement-inlines. If any calls were not inlined, you will get linker errors. Did the compilation with the option fno-implement-inlines But, it failed for the same reasons. Thanks, Ramya. pinskia at gcc dot gnu dot org wrote: >------- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-20 13:28 ------- >Two things for specialization you have to define the template functions like: >template<> IOCM::Status IOCM_SequenceTempl::_unpack(IOCM::MessageBox& msgBox) > >instead of the current without "template<>", This is rejected in 3.4.0 and above because of that. > >The other thing instead of copy and pasting the preprocessed source, next time please attach it. > > > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055