aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/friend.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-08-30 22:50:08 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-08-30 22:50:08 -0400
commit091bffba90e0c70f76ee138f92024a6f3b7aa2bc (patch)
tree424314c23f47f26c9a20d19dc68f81690672bb2e /gcc/cp/friend.c
parent5cb25c9c7b6581f62151741e3ceb2c5e57def30e (diff)
downloadgcc-091bffba90e0c70f76ee138f92024a6f3b7aa2bc.zip
gcc-091bffba90e0c70f76ee138f92024a6f3b7aa2bc.tar.gz
gcc-091bffba90e0c70f76ee138f92024a6f3b7aa2bc.tar.bz2
friend.c (make_friend_class): Handle template template parameters.
* friend.c (make_friend_class): Handle template template parameters. * parser.c (cp_parser_template_declaration_after_export): Likewise. * pt.c (tsubst_friend_class): Likewise. (instantiate_class_template_1): Likewise * decl.c (check_elaborated_type_specifier): Likewise. (lookup_and_check_tag): Likewise. From-SVN: r190828
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r--gcc/cp/friend.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index d0cbaed..d4548ff 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -224,7 +224,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
int class_template_depth = template_class_depth (type);
int friend_depth = processing_template_decl - class_template_depth;
- if (! MAYBE_CLASS_TYPE_P (friend_type))
+ if (! MAYBE_CLASS_TYPE_P (friend_type)
+ && TREE_CODE (friend_type) != TEMPLATE_TEMPLATE_PARM)
{
/* N1791: If the type specifier in a friend declaration designates a
(possibly cv-qualified) class type, that class is declared as a
@@ -349,6 +350,8 @@ make_friend_class (tree type, tree friend_type, bool complain)
error ("template parameter type %qT declared %<friend%>", friend_type);
return;
}
+ else if (TREE_CODE (friend_type) == TEMPLATE_TEMPLATE_PARM)
+ friend_type = TYPE_NAME (friend_type);
else if (!CLASSTYPE_TEMPLATE_INFO (friend_type))
{
/* template <class T> friend class A; where A is not a template */