aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/traits.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/traits.hxx b/odb/traits.hxx
index 1cb2613..2c6f5d6 100644
--- a/odb/traits.hxx
+++ b/odb/traits.hxx
@@ -71,6 +71,14 @@ namespace odb
typedef T value_type;
typedef P pointer_type;
+
+ // Suppress bogus use-after-free introduced in GCC 12 (GCC bug #105327).
+ //
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wuse-after-free"
+#endif
+
static P
create ()
{
@@ -81,6 +89,10 @@ namespace odb
return p;
}
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12
+#pragma GCC diagnostic pop
+#endif
+
private:
struct mem_guard
{