public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18055] New: seems not possible to specialize a template member function
@ 2004-10-19  9:20 ramya dot chandar at wipro dot com
  2004-10-19 11:27 ` [Bug c++/18055] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: ramya dot chandar at wipro dot com @ 2004-10-19  9:20 UTC (permalink / raw)
  To: gcc-bugs

Environment     : i686-pc-linux-gnu
Compiler Version: GCC 3.3.2 
Kernel Version  : 2.4.7-10

It seems, not possible to specialize a template member functions const. I got a
file(.impl) which got the following template functions( generalized and
specialized template functions ) and i got the corresponding header file ( where
this .impl file is getting included ).

IOCM::Status IOCM_SequenceTempl<IOCM::Char>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::Octet>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::Short>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::UShort>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::Long>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::ULong>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<IOCM::Float>::_skip(IOCM::MessageBox& msgBox);
IOCM::Status IOCM_SequenceTempl<T>::_skip(IOCM::MessageBox& msgBox);


But, the build is getting failed during linking stage with the below mentioned
error( for all the template functions ).

There is no problem with 2.95.3

Linking fails with the following error( for all the template functions ).

/cm4/fsn/app/asam/atm2/nt/../export/idl/AtmApplication_ifc.cc:344: undefined
reference to `IOCM_SequenceTempl<Eqpt::LogicalIfIndex>::_size(void) const'
/cm4/fsn/app/asam/atm2/nt/../export/idl/AtmApplication_ifc.cc:349: undefined
reference to `IOCM_SequenceTempl<Eqpt::LogicalIfIndex>::_pack(IOCM_MessageBox &)
const'

-- 
           Summary: seems not possible to specialize a template member
                    function
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ramya dot chandar at wipro dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: Linux linux3 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001
                    i686


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
  2004-10-19 11:27 ` [Bug c++/18055] " pinskia at gcc dot gnu dot org
@ 2004-10-19 11:27 ` pinskia at gcc dot gnu dot org
  2004-10-19 11:46 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-19 11:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-19 11:27 -------
Can you attach the preprocessed source?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
@ 2004-10-19 11:27 ` pinskia at gcc dot gnu dot org
  2004-10-19 11:27 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-19 11:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-19 11:27 -------
*** Bug 18056 has been marked as a duplicate of this bug. ***

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
  2004-10-19 11:27 ` [Bug c++/18055] " pinskia at gcc dot gnu dot org
  2004-10-19 11:27 ` pinskia at gcc dot gnu dot org
@ 2004-10-19 11:46 ` giovannibajo at libero dot it
  2004-10-20 13:28 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-10-19 11:46 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-10-19 11:46 -------
I fixed a similar bug in 4.0 already, but we can't really tell until either you 
try for yourself or attacch a preprocessed file.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
                   ` (2 preceding siblings ...)
  2004-10-19 11:46 ` giovannibajo at libero dot it
@ 2004-10-20 13:28 ` pinskia at gcc dot gnu dot org
  2004-10-21  3:49 ` ramya dot chandar at wipro dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-20 13:28 UTC (permalink / raw)
  To: gcc-bugs


------- 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<IOCM::Float>::_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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
                   ` (3 preceding siblings ...)
  2004-10-20 13:28 ` pinskia at gcc dot gnu dot org
@ 2004-10-21  3:49 ` ramya dot chandar at wipro dot com
  2004-11-04 11:31 ` ramya dot chandar at wipro dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ramya dot chandar at wipro dot com @ 2004-10-21  3:49 UTC (permalink / raw)
  To: gcc-bugs


------- 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<IOCM::Float>::_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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
                   ` (4 preceding siblings ...)
  2004-10-21  3:49 ` ramya dot chandar at wipro dot com
@ 2004-11-04 11:31 ` ramya dot chandar at wipro dot com
  2004-11-04 13:39 ` pinskia at gcc dot gnu dot org
  2004-11-04 14:08 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: ramya dot chandar at wipro dot com @ 2004-11-04 11:31 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
             Status|WAITING                     |NEW
           Priority|P2                          |P1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
                   ` (5 preceding siblings ...)
  2004-11-04 11:31 ` ramya dot chandar at wipro dot com
@ 2004-11-04 13:39 ` pinskia at gcc dot gnu dot org
  2004-11-04 14:08 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-04 13:39 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug c++/18055] seems not possible to specialize a template member function
  2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
                   ` (6 preceding siblings ...)
  2004-11-04 13:39 ` pinskia at gcc dot gnu dot org
@ 2004-11-04 14:08 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 9+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-04 14:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-04 14:08 -------
Sorry Ramya, this report is too confusing because of the millions of lines 
pasted in it. Would you please open a new bug report and this time *attacch* 
the preprocessed source to it?

To attacch it, you must click on the link "Create a new Attacchment", after you 
have created the bug report.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18055


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2004-11-04 14:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-19  9:20 [Bug c++/18055] New: seems not possible to specialize a template member function ramya dot chandar at wipro dot com
2004-10-19 11:27 ` [Bug c++/18055] " pinskia at gcc dot gnu dot org
2004-10-19 11:27 ` pinskia at gcc dot gnu dot org
2004-10-19 11:46 ` giovannibajo at libero dot it
2004-10-20 13:28 ` pinskia at gcc dot gnu dot org
2004-10-21  3:49 ` ramya dot chandar at wipro dot com
2004-11-04 11:31 ` ramya dot chandar at wipro dot com
2004-11-04 13:39 ` pinskia at gcc dot gnu dot org
2004-11-04 14:08 ` giovannibajo at libero dot it

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).