diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 985206f6a6496611cb863ba048f112720ceb2aa6..b72a28c1aa943013ee45ed77de36a8dbffbb1a91 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -975,6 +975,7 @@ check_handlers_1 (tree master, tree_stmt_iterator i)
       tree handler = tsi_stmt (i);
       if (TREE_TYPE (handler) && can_convert_eh (type, TREE_TYPE (handler)))
 	{
+	  auto_diagnostic_group d;
 	  if (warning_at (EXPR_LOCATION (handler), OPT_Wexceptions,
 			  "exception of type %qT will be caught by earlier "
 			  "handler", TREE_TYPE (handler)))