re PR c++/37256 (extern template / explicit instantiation broken in 4.4.0-pre)

PR c++/37256
        * pt.c (instantiate_decl): Don't require a definition of
        a template that is explicitly instantiated 'extern'.

From-SVN: r142014
This commit is contained in:
Jason Merrill 2008-11-19 14:27:29 -05:00 committed by Jason Merrill
parent 2ad646bdca
commit da3933ba83
4 changed files with 29 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-11-19 Jason Merrill <jason@redhat.com>
PR c++/37256
* pt.c (instantiate_decl): Don't require a definition of
a template that is explicitly instantiated 'extern'.
2008-11-18 Jason Merrill <jason@redhat.com>
Jakub Jelinek <jakub@redhat.com>

View File

@ -15226,7 +15226,8 @@ instantiate_decl (tree d, int defer_ok,
input_location = saved_loc;
if (at_eof && !pattern_defined
&& DECL_EXPLICIT_INSTANTIATION (d))
&& DECL_EXPLICIT_INSTANTIATION (d)
&& DECL_NOT_REALLY_EXTERN (d))
/* [temp.explicit]
The definition of a non-exported function template, a

View File

@ -1,3 +1,8 @@
2008-11-19 Jason Merrill <jason@redhat.com>
PR c++/37256
* g++.dg/cpp0x/extern_template-3.C: New test.
2008-11-19 Maxim Kuvyrkov <maxim@codesourcery.com>
* gcc.target/m68k/xgot-1.c (dg-options): Add -O2.

View File

@ -0,0 +1,16 @@
// PR c++/37256
// { dg-options "-O" }
template <typename T_>
struct B
{
T_ f();
};
extern template class B<int>;
void f()
{
B<int> t;
t.f();
}