mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-17 06:38:55 +08:00
* pt.c (tsubst_decl): Tsubst into DECL_BEFRIENDING_CLASSES.
From-SVN: r25982
This commit is contained in:
parent
4e8d7ddc2a
commit
cf38f48a33
@ -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
|
||||
|
12
gcc/cp/pt.c
12
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);
|
||||
|
11
gcc/testsuite/g++.old-deja/g++.pt/friend40.C
Normal file
11
gcc/testsuite/g++.old-deja/g++.pt/friend40.C
Normal file
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user