From: Jakub Jelinek Date: Tue, 28 Aug 2007 16:08:02 +0000 (+0200) Subject: re PR c++/32596 (ICE with inline template specialization in anonymous namespace) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92d0af977fea398604540282f2ff2789dd525eaa;p=gcc.git re PR c++/32596 (ICE with inline template specialization in anonymous namespace) PR c++/32596 PR c++/32400 * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN and DECL_NOT_REALLY_EXTERN if tmpl_func is not public. * g++.dg/ext/visibility/anon5.C: New test. From-SVN: r127863 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 03d6b51c1a6..f612c9cb9d6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-28 Jakub Jelinek + + PR c++/32596 + PR c++/32400 + * pt.c (check_explicit_specialization): Set DECL_INTERFACE_KNOWN + and DECL_NOT_REALLY_EXTERN if tmpl_func is not public. + 2007-08-27 Jason Merrill PR c++/28558 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1bbe6cb80c6..e33197c5c45 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -2217,6 +2217,11 @@ check_explicit_specialization (tree declarator, /* This specialization has the same linkage and visibility as the function template it specializes. */ TREE_PUBLIC (decl) = TREE_PUBLIC (tmpl_func); + if (! TREE_PUBLIC (decl)) + { + DECL_INTERFACE_KNOWN (decl) = 1; + DECL_NOT_REALLY_EXTERN (decl) = 1; + } DECL_THIS_STATIC (decl) = DECL_THIS_STATIC (tmpl_func); if (DECL_VISIBILITY_SPECIFIED (tmpl_func)) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1ab202ab167..0bbe27a9bef 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-28 Jakub Jelinek + + PR c++/32596 + * g++.dg/ext/visibility/anon5.C: New test. + 2007-07-28 Dominique d'Humieres * gfortran.dg/gamma_4.f90: Fix large-real kind selection. diff --git a/gcc/testsuite/g++.dg/ext/visibility/anon5.C b/gcc/testsuite/g++.dg/ext/visibility/anon5.C new file mode 100644 index 00000000000..d069eeab661 --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/anon5.C @@ -0,0 +1,8 @@ +// PR c++/32596 +// { dg-do compile } + +namespace +{ + template inline void char_less(void) { } + template<> inline void char_less(void) { } +}