aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorKriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>2004-08-24 14:13:50 +0000
committerKriang Lerdsuwanakij <lerdsuwa@gcc.gnu.org>2004-08-24 14:13:50 +0000
commite59f7322effb7542b4311ec731ce45565ef600f6 (patch)
tree6ae9210737b086cc8b633394372bbf40e57e713a /gcc/cp
parenta1a28bb5826211ea2253231186417fb3cb6de6dd (diff)
downloadgcc-e59f7322effb7542b4311ec731ce45565ef600f6.zip
gcc-e59f7322effb7542b4311ec731ce45565ef600f6.tar.gz
gcc-e59f7322effb7542b4311ec731ce45565ef600f6.tar.bz2
re PR c++/16706 (ICE in finish_member_declaration, at cp/semantics.c:2126)
PR c++/16706 * search.c (friend_accessible_p): Increment processing_template_decl when deal with TEMPLATE_DECL of SCOPE. * g++.dg/template/crash21.C: New test. * g++.dg/template/crash22.C: Likewise. From-SVN: r86482
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/search.c20
2 files changed, 24 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index ddeb19e..9ac0c74 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-24 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/16706
+ * search.c (friend_accessible_p): Increment processing_template_decl
+ when deal with TEMPLATE_DECL of SCOPE.
+
2004-08-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/17149
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index df5804b..81226d1 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -835,10 +835,26 @@ friend_accessible_p (tree scope, tree decl, tree binfo)
/* Or an instantiation of something which is a friend. */
if (DECL_TEMPLATE_INFO (scope))
- return friend_accessible_p (DECL_TI_TEMPLATE (scope), decl, binfo);
+ {
+ int ret;
+ /* Increment processing_template_decl to make sure that
+ dependent_type_p works correctly. */
+ ++processing_template_decl;
+ ret = friend_accessible_p (DECL_TI_TEMPLATE (scope), decl, binfo);
+ --processing_template_decl;
+ return ret;
+ }
}
else if (CLASSTYPE_TEMPLATE_INFO (scope))
- return friend_accessible_p (CLASSTYPE_TI_TEMPLATE (scope), decl, binfo);
+ {
+ int ret;
+ /* Increment processing_template_decl to make sure that
+ dependent_type_p works correctly. */
+ ++processing_template_decl;
+ ret = friend_accessible_p (CLASSTYPE_TI_TEMPLATE (scope), decl, binfo);
+ --processing_template_decl;
+ return ret;
+ }
return 0;
}