Lines Matching defs:friend

378    a friend template defined in a class definition.  */
815 struct S { friend A::f(); };
817 Here, the friend function is a template, but the context does
960 /* Returns nonzero iff DECL is a specialization of friend declaration
961 FRIEND according to [temp.friend]. */
964 is_specialization_of_friend (tree decl, tree friend)
972 /* For [temp.friend/6] when FRIEND is an ordinary member function
975 if (TREE_CODE (friend) == FUNCTION_DECL
976 && DECL_TEMPLATE_INFO (friend)
977 && !DECL_USE_TEMPLATE (friend))
980 friend = DECL_TI_TEMPLATE (friend);
983 else if (TREE_CODE (friend) == TEMPLATE_DECL
984 && !PRIMARY_TEMPLATE_P (friend))
987 /* There is nothing to do if this is not a template friend. */
988 if (TREE_CODE (friend) != TEMPLATE_DECL)
991 if (is_specialization_of (decl, friend))
994 /* [temp.friend/6]
995 A member of a class template may be declared to be a friend of a
997 every specialization of the class template is a friend of the
1000 For example, given a template friend declaration
1002 template <class T> friend void A<T>::f();
1004 the member function below is considered a friend
1010 For this type of template friend, TEMPLATE_DEPTH below will be
1011 nonzero. To determine if DECL is a friend of FRIEND, we first
1014 template_depth = template_class_depth (DECL_CONTEXT (friend));
1018 CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (friend))))
1023 template <class T> friend void A<T>::g(T t);
1024 template <class T> template <T t> friend void A<T>::h();
1071 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend),
1083 friend_type = tsubst_function_type (TREE_TYPE (friend), args,
1096 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend))
1123 != DECL_NAME (friend))
1128 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend),
1136 == DECL_NAME (friend));
1144 is actually just a friend declaration. Returns SPEC, or an
1200 We can also wind up here if a friend declaration that
1205 class S { friend void foo<>(int) };
1793 4: The function is a friend.
1856 class S { friend void f<>(int); } */
2130 example, if TMPL is a friend template that is
2186 /* If DECL is a friend declaration, declared using an
2192 struct S { friend void f<int>(int); }
2195 we will have set the DECL_CONTEXT for the friend
2874 /* If this is either a friend defined in the scope of the class
3022 If IS_FRIEND is true, DECL is a friend declaration. */
3050 /* For a friend, we want the context of the friend function, not
3051 the type of which it is a friend. */
3071 /* A friend template that specifies a class context, i.e.
3072 template <typename T> friend void A<T>::f();
3271 that we do not try to push a global template friend declared in a
3281 /* Hide template friend classes that haven't been declared yet. */
5301 /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the
5304 Returns an appropriate tsubst'd friend declaration. */
5314 /* This was a friend declared with an explicit template
5317 friend void f<>(T);
5356 template <class U> friend void f(T, U);
5414 current namespace. However, the friend function should go
5426 /* This new friend declaration matched an existing
5431 template <class T> friend void f(T) {}
5434 the friend declaration actually provides the definition
5452 friend void f(int);
5454 friend void f(T) {}
5523 template <class U> friend void C1<U>::f (); // case 1
5524 friend void C2<T>::f (); // case 2
5553 /* FRIEND_TMPL is a friend TEMPLATE_DECL. ARGS is the vector of
5556 Returns an appropriate tsubst'd friend type or error_mark_node on
5577 because two friend declarations of the same template are the
5581 template <typename> friend class F;
5584 template <typename> friend class F;
5598 friend struct S;
5611 /* The friend template has already been declared. Just
5630 /* The friend template has not already been declared. In this
5993 /* template <class T> friend class C; */
5999 /* template <class T> friend class C::D; */
6010 friend class T::C;
6014 template <class U> friend class T::C;
6029 /* friend class C;
6036 /* The call to xref_tag_from_type does injection for friend
6045 /* friend class C<T>; */
6050 friend class C;
6054 friend class C<int>;
6059 /* Trick make_friend_class into realizing that the friend
6621 template <class U> friend void f();
6650 friend void f<int>(int, double);
6653 Here, the DECL_TI_TEMPLATE for the friend declaration
6723 this in the special friend case mentioned above where
11502 template friend. */
12022 /* We must also deal with friend templates. Given:
12025 template <class U> friend void f() {};
12034 template <class U> friend void f();
12036 template <class U> friend void f() {}
12138 /* In the case of a friend template whose definition is provided