diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-15 09:31:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-15 09:31:42 +0200 |
commit | 3705ad7d8fa00e3992f09359c7f008cdeaa5f56c (patch) | |
tree | 3b668ca18118b9dc31e2167d26c27297218e8f9b /core/templates/cowdata.h | |
parent | 0e7beb183ac4b3dbebf83b9ded838f60cc318920 (diff) | |
parent | abef2b7194d5dd7aac09e3817598dcce86ae2333 (diff) |
Merge pull request #52123 from lightspot21/fix-placement-new-warning
Silence false-positive warning for malformed placement new on GCC 11.1
Diffstat (limited to 'core/templates/cowdata.h')
-rw-r--r-- | core/templates/cowdata.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index ba9babe0af..9b8c0eb528 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -49,6 +49,12 @@ class VMap; SAFE_NUMERIC_TYPE_PUN_GUARANTEES(uint32_t) #endif +// Silence a false positive warning (see GH-52119). +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wplacement-new" +#endif + template <class T> class CowData { template <class TV> @@ -380,4 +386,8 @@ CowData<T>::~CowData() { _unref(_ptr); } +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + #endif // COWDATA_H |