diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-03-25 13:28:41 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-03-25 13:28:41 +0000 |
commit | cf38f48a33db6760662fb12716f87b3e3a9ac732 (patch) | |
tree | 2fb8f30bee1981c6862f42fc02589582fa67f6d5 /gcc | |
parent | 4e8d7ddc2a4fc825984ca301f5e12e9f4a739ec2 (diff) | |
download | gcc-cf38f48a33db6760662fb12716f87b3e3a9ac732.zip gcc-cf38f48a33db6760662fb12716f87b3e3a9ac732.tar.gz gcc-cf38f48a33db6760662fb12716f87b3e3a9ac732.tar.bz2 |
* pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES.
From-SVN: r25982
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/pt.c | 12 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/friend40.C | 11 |
3 files changed, 27 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6ed08ef..b6bff82 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1999-03-25 Mark Mitchell <mark@codesourcery.com> + + * pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES. + 1999-03-25 Nathan Sidwell <nathan@acm.org> * decl.c (init_decl_processing): Add `signed' type as a synonym diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f7372dd..812cf94 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -5470,6 +5470,7 @@ tsubst_decl (t, args, type, in_decl) { tree ctx; tree argvec = NULL_TREE; + tree *friends; tree gen_tmpl; int member; int args_depth; @@ -5669,6 +5670,17 @@ tsubst_decl (t, args, type, in_decl) SET_IDENTIFIER_GLOBAL_VALUE (DECL_ASSEMBLER_NAME (r), r); } + /* Copy the list of befriending classes. */ + for (friends = &DECL_BEFRIENDING_CLASSES (r); + *friends; + friends = &TREE_CHAIN (*friends)) + { + *friends = copy_node (*friends); + TREE_VALUE (*friends) = tsubst (TREE_VALUE (*friends), + args, /*complain=*/1, + in_decl); + } + if (DECL_CONSTRUCTOR_P (r)) { maybe_retrofit_in_chrg (r); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend40.C b/gcc/testsuite/g++.old-deja/g++.pt/friend40.C new file mode 100644 index 0000000..7840629 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/friend40.C @@ -0,0 +1,11 @@ +// Build don't link: +// Origin: Jason Merrill <jason@cygnus.com> + +template<class T> struct A +{ + friend void f (); +}; + +A<short> a; +A<int> b; + |