public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19569] New: no code for explicit instantiation of template class specialization
@ 2005-01-21 18:12 jamesp at trdlnk dot com
  2005-01-22 18:37 ` [Bug c++/19569] " bangerth at dealii dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jamesp at trdlnk dot com @ 2005-01-21 18:12 UTC (permalink / raw)
  To: gcc-bugs

It appears that explicit instantiation of specialized template classes isn't
instantiating all of the class's members as it should:

--- Begin Sample Code ------------
template <typename T>
class A
{
public:
    void foo( T const & ) {}
};

template <>
class A<char>
{
public:
    void foo( char const & ) {}
};

template class A<int>;
template class A<char>;

--- End Sample Code ------------

When I compile the above code and run nm on the object file, I get:
%nm test.o
00000000 W _ZN1AIiE3fooERKi
%

The explicit instantiation of the char specialization of class A should have
created A<char>::foo(char const &).

-- 
           Summary: no code for explicit instantiation of template class
                    specialization
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jamesp at trdlnk dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2005-01-24 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-21 18:12 [Bug c++/19569] New: no code for explicit instantiation of template class specialization jamesp at trdlnk dot com
2005-01-22 18:37 ` [Bug c++/19569] " bangerth at dealii dot org
2005-01-24 14:03 ` jamesp at trdlnk dot com
2005-01-24 14:27 ` lerdsuwa at gcc dot gnu dot org
2005-01-24 14:30 ` pinskia at gcc dot gnu dot org
2005-01-24 14:56 ` jamesp at trdlnk dot com

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).