diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2022-04-21 10:13:43 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2022-04-21 10:13:43 +0200 |
commit | d469ccfd4f8e2c7f3c0359c481d58231572a44d9 (patch) | |
tree | 7318ae425f9dd6d17ac554478cabc8e14c34d81d | |
parent | 88c9b1acd2b372d1405a40fb3e3802d411709fd4 (diff) |
Suppress bogus use-after-free warning in GCC 12 (GCC bug #105327)
-rw-r--r-- | odb/traits.hxx | 12 |
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 { |