public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22263] New: explicit instantiation fails to emit symbols defined later
@ 2005-06-30 23:18 sebor at roguewave dot com
  2005-06-30 23:26 ` [Bug c++/22263] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: sebor at roguewave dot com @ 2005-06-30 23:18 UTC (permalink / raw)
  To: gcc-bugs

The program below fails to link with g++ 4.0 on Solaris 9 (I didn't try Linux).
It appears that symbols defined after the explicit instantiation directive
aren't emitted even when referenced. This works fine with prior versions of gcc.

$ cat u.cpp && g++ u.cpp
template <class T> struct S { T foo (); T bar (); };
template <class T> T S<T>::foo () { return bar (); }
template struct S<int>;
template <class T> T S<T>::bar () { return T (); }

int main () { return S<int>().foo (); }
Undefined                       first referenced
 symbol                             in file
S<int>::bar()                       /var/tmp//cc4BNMlG.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status

-- 
           Summary: explicit instantiation fails to emit symbols defined
                    later
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: sparc-sun-solaris2.9
  GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9


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


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

end of thread, other threads:[~2005-10-01 17:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-30 23:18 [Bug c++/22263] New: explicit instantiation fails to emit symbols defined later sebor at roguewave dot com
2005-06-30 23:26 ` [Bug c++/22263] " pinskia at gcc dot gnu dot org
2005-06-30 23:36 ` sebor at roguewave dot com
2005-06-30 23:49 ` pinskia at gcc dot gnu dot org
2005-06-30 23:57 ` sebor at roguewave dot com
2005-07-01  0:06 ` sebor at roguewave dot com
2005-07-01 19:07 ` [Bug c++/22263] [4.0/4.1 Regression] " pinskia at gcc dot gnu dot org
2005-07-06 16:39 ` mmitchel at gcc dot gnu dot org
2005-07-17 23:10 ` mmitchel at gcc dot gnu dot org
2005-07-18 15:57 ` cvs-commit at gcc dot gnu dot org
2005-07-18 17:15 ` cvs-commit at gcc dot gnu dot org
2005-07-18 17:24 ` mmitchel at gcc dot gnu dot org
2005-10-01 17:07 ` pinskia at gcc dot gnu dot org

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