re PR c++/45651 (ICE in import_export_decl, at cp/decl2.c:2344)

PR c++/45651
	* pt.c (instantiate_decl): Don't clear DECL_INTERFACE_KNOWN on
	!TREE_PUBLIC decls.

From-SVN: r170805
This commit is contained in:
Jason Merrill 2011-03-08 20:28:13 -05:00 committed by Jason Merrill
parent 8ca44716ad
commit 1c37c75b3f
4 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2011-03-08 Jason Merrill <jason@redhat.com>
PR c++/45651
* pt.c (instantiate_decl): Don't clear DECL_INTERFACE_KNOWN on
!TREE_PUBLIC decls.
2011-03-08 Jason Merrill <jason@redhat.com>
PR c++/47289

View File

@ -15533,8 +15533,13 @@ instantiate_decl (tree d, int defer_ok,
if (!pattern_defined && expl_inst_class_mem_p
&& DECL_EXPLICIT_INSTANTIATION (d))
{
DECL_NOT_REALLY_EXTERN (d) = 0;
DECL_INTERFACE_KNOWN (d) = 0;
/* Leave linkage flags alone on instantiations with anonymous
visibility. */
if (TREE_PUBLIC (d))
{
DECL_NOT_REALLY_EXTERN (d) = 0;
DECL_INTERFACE_KNOWN (d) = 0;
}
SET_DECL_IMPLICIT_INSTANTIATION (d);
}

View File

@ -1,3 +1,7 @@
2011-03-08 Jason Merrill <jason@redhat.com>
* g++.dg/template/anon5.C: New.
2011-03-08 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/variadic105.C: New.

View File

@ -0,0 +1,6 @@
// PR c++/45651
namespace { template <int T> struct A {}; }
template <int T> struct B { void f(A<T>); };
template struct B<1>;
template<int T> void B<T>::f(A<T>) {}