Closed Quuxplusone closed 14 years ago
Bugzilla Link | PR6674 |
Status | RESOLVED FIXED |
Importance | P normal |
Reported by | Roman Divacky (rdivacky@freebsd.org) |
Reported on | 2010-03-22 07:00:51 -0700 |
Last modified on | 2010-03-26 22:51:28 -0700 |
Version | unspecified |
Hardware | PC Linux |
CC | dgregor@apple.com, llvm-bugs@lists.llvm.org, pinskia@gmail.com, rafael@espindo.la |
Fixed by commit(s) | |
Attachments | |
Blocks | PR6266 |
Blocked by | |
See also |
when linking with real libstdc it complains about destructor... ie.
U _ZNSt13basic_istreamIwSt11char_traitsIwEED0Ev
U _ZNSt13basic_istreamIwSt11char_traitsIwEED1Ev
the other symbol differences may be interesting too
I am changing the summary to explain what the issue is with. It is an extern template issue.
Reduced case:
-----------------------------------------
template<typename _CharT>
class basic_istream {
virtual ~basic_istream() {
}
void ignore(long __n);
};
template<>
void basic_istream<wchar_t>::ignore(long __n) {
}
extern template class basic_istream<wchar_t>
---------------------------------------
The problem is that the specialization of "ignore" causes us to produce the the
vtable for basic_istram and the "extern template" declaration causes us to use
refer to the destructor as an external decl.
The issue is that I think this is actually the correct behavior. The destructor
should be emitted in the with with
template class basic_istream<wchar_t>
Are we not doing so?
I managed to compile part of gcc 4.5's libstdc++ with clang and with small
changes like
- { return { __n }; }
+ { _Setw foo = { __n }; return foo; }
istream-inst.o builds correctly and I get:
nm .libs/istream-inst.o |grep _ZNSt13basic_istreamIwSt11char_traitsIwEED0Ev
0000000000000000 W _ZNSt13basic_istreamIwSt11char_traitsIwEED0Ev
I am closing the bug since it looks like we are emitting the destructor, just
not exactly in the same places as gcc.
Please reopen the bug if you still see undefined symbols in the final libstdc++.