diff --git a/gcc/cp/method.cc b/gcc/cp/method.cc index 3b8dc75d198..957496d3e18 100644 --- a/gcc/cp/method.cc +++ b/gcc/cp/method.cc @@ -1229,6 +1229,7 @@ early_check_defaulted_comparison (tree fn) ctx = TYPE_MAIN_VARIANT (parmtype); if (!is_friend (ctx, fn)) { + auto_diagnostic_group d; error_at (loc, "defaulted %qD is not a friend of %qT", fn, ctx); inform (location_of (ctx), "declared here"); ok = false;