Fix a proble building the libiberty library with gcc-12.

	PR 28779
	* regex.c: Suppress -Wuse-after-free.
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 04c9e90..40611e5 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,7 @@
+2022-01-15  Martin Sebor  <msebor@redhat.com>
+
+	* regex.c: Suppress -Wuse-after-free.
+
 2022-01-22  Nick Clifton  <nickc@redhat.com>
 
 	* 2.38 release branch created.
diff --git a/libiberty/regex.c b/libiberty/regex.c
index cc5a460..84af527 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -30,6 +30,10 @@
   #pragma alloca
 #endif
 
+#if __GNUC__ >= 12
+#  pragma GCC diagnostic ignored "-Wuse-after-free"
+#endif
+
 #undef	_GNU_SOURCE
 #define _GNU_SOURCE