diff options
author | Jakub Jelinek <jakub@redhat.com> | 2007-08-28 18:08:02 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2007-08-28 18:08:02 +0200 |
commit | 92d0af977fea398604540282f2ff2789dd525eaa (patch) | |
tree | 2419cf0c920ad4437cda9f7d671ade83c7f294b4 /gcc | |
parent | 6a1eb6a415d1a6336064babf147fba345e0d42bb (diff) | |
download | gcc-92d0af977fea398604540282f2ff2789dd525eaa.zip gcc-92d0af977fea398604540282f2ff2789dd525eaa.tar.gz gcc-92d0af977fea398604540282f2ff2789dd525eaa.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/pt.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/visibility/anon5.C | 8 |
4 files changed, 25 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 03d6b51..f612c9c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2007-08-28 Jakub Jelinek <jakub@redhat.com> + + 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 <jason@redhat.com> PR c++/28558 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 1bbe6cb..e33197c 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 1ab202a..0bbe27a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-28 Jakub Jelinek <jakub@redhat.com> + + PR c++/32596 + * g++.dg/ext/visibility/anon5.C: New test. + 2007-07-28 Dominique d'Humieres <dominiq@lps.ens.fr> * 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 0000000..d069eea --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/visibility/anon5.C @@ -0,0 +1,8 @@ +// PR c++/32596 +// { dg-do compile } + +namespace +{ + template<class T> inline void char_less(void) { } + template<> inline void char_less<char>(void) { } +} |