diff options
Diffstat (limited to 'gcc/cp/friend.c')
-rw-r--r-- | gcc/cp/friend.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c index 2c9c12f..ce85a80 100644 --- a/gcc/cp/friend.c +++ b/gcc/cp/friend.c @@ -304,6 +304,7 @@ make_friend_class (tree type, tree friend_type, bool complain) if (TYPE_TEMPLATE_INFO (friend_type) && !PRIMARY_TEMPLATE_P (TYPE_TI_TEMPLATE (friend_type))) { + auto_diagnostic_group d; error ("%qT is not a template", friend_type); inform (location_of (friend_type), "previous declaration here"); if (TYPE_CLASS_SCOPE_P (friend_type) @@ -384,6 +385,7 @@ make_friend_class (tree type, tree friend_type, bool complain) } if (template_member_p && !DECL_CLASS_TEMPLATE_P (decl)) { + auto_diagnostic_group d; error ("%qT is not a member class template of %qT", name, ctype); inform (DECL_SOURCE_LOCATION (decl), @@ -393,6 +395,7 @@ make_friend_class (tree type, tree friend_type, bool complain) if (!template_member_p && (TREE_CODE (decl) != TYPE_DECL || !CLASS_TYPE_P (TREE_TYPE (decl)))) { + auto_diagnostic_group d; error ("%qT is not a nested class of %qT", name, ctype); inform (DECL_SOURCE_LOCATION (decl), @@ -636,6 +639,7 @@ do_friend (tree ctype, tree declarator, tree decl, static int explained; bool warned; + auto_diagnostic_group d; warned = warning (OPT_Wnon_template_friend, "friend declaration " "%q#D declares a non-template function", decl); if (! explained && warned) |