diff options
author | Jason Merrill <jason@redhat.com> | 2012-08-30 22:50:08 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-08-30 22:50:08 -0400 |
commit | 091bffba90e0c70f76ee138f92024a6f3b7aa2bc (patch) | |
tree | 424314c23f47f26c9a20d19dc68f81690672bb2e /gcc/cp/friend.c | |
parent | 5cb25c9c7b6581f62151741e3ceb2c5e57def30e (diff) | |
download | gcc-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.c | 5 |
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 */ |