From 4993d0265ef8ff1a75dfb86cd6da95ccc7fa6328 Mon Sep 17 00:00:00 2001
From: Iain Buclaw <ibuclaw@gdcproject.org>
Date: Wed, 3 Jun 2020 11:51:12 +0200
Subject: [PATCH] d: Increment gaggedWarnings if warning or deprecation message
 was suppressed

gcc/d/ChangeLog:

	* d-diagnostic.cc (vwarning): Increment gaggedWarnings if warning
	message	was suppressed.
	(vdeprecation): Likewise for deprecation messages.
---
 gcc/d/d-diagnostic.cc | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/d/d-diagnostic.cc b/gcc/d/d-diagnostic.cc
index 659fae24459e..3bf5a535eddd 100644
--- a/gcc/d/d-diagnostic.cc
+++ b/gcc/d/d-diagnostic.cc
@@ -239,6 +239,8 @@ vwarning (const Loc &loc, const char *format, va_list ap)
 
       d_diagnostic_report_diagnostic (loc, 0, format, ap, DK_WARNING, false);
     }
+  else if (global.gag)
+    global.gaggedWarnings++;
 }
 
 /* Print supplementary message about the last warning with explicit location
@@ -297,6 +299,8 @@ vdeprecation (const Loc &loc, const char *format, va_list ap,
 				      DK_WARNING, false);
       free (xformat);
     }
+  else if (global.gag)
+    global.gaggedWarnings++;
 }
 
 /* Print supplementary message about the last deprecation with explicit
-- 
GitLab