Skip to content

Commit

Permalink
Merge pull request #52123 from lightspot21/fix-placement-new-warning
Browse files Browse the repository at this point in the history
Silence false-positive warning for malformed placement new on GCC 11.1
  • Loading branch information
akien-mga authored Sep 15, 2021
2 parents 0e7beb1 + abef2b7 commit 3705ad7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/templates/cowdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -380,4 +386,8 @@ CowData<T>::~CowData() {
_unref(_ptr);
}

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#endif // COWDATA_H

0 comments on commit 3705ad7

Please sign in to comment.