diff --git a/list/sort.hpp b/list/sort.hpp index 4f7f6b6d..a841697b 100644 --- a/list/sort.hpp +++ b/list/sort.hpp @@ -109,6 +109,15 @@ namespace cruft::list { #if defined(COMPILER_CLANG) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wpointer-bool-conversion" + #elif defined(COMPILER_GCC) + // gcc#11 If we rely on the _Pragma embedded in `CHECK` then GCC 11 + // will still issue a warning for the null assert we're about to do + // (but oddly only for some uses of this file...). + // + // Issuing the _Pragma locally is an effective workaround. + // It's unclear how we can produce a repro for this. + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wnonnull-compare" #endif CHECK (first); @@ -146,6 +155,8 @@ namespace cruft::list { #if defined(COMPILER_CLANG) #pragma GCC diagnostic pop + #elif defined(COMPILER_GCC) + #pragma GCC diagnostic pop #endif return head;