diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h --- a/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_procmaps.h @@ -84,10 +84,14 @@ // This destructor cannot be virtual, as it would cause an operator new() linking // failures in hwasan test cases. However non-virtual destructors emit warnings // in macOS build, hence disabling those +#ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wnon-virtual-dtor" +#endif ~MemoryMappingLayout(); +#ifdef __clang__ #pragma clang diagnostic pop +#endif virtual bool Next(MemoryMappedSegment *segment) override; virtual bool Error() const override;