From ab8b151808af1bcc36ddbbeb19436029c1f18a2c Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sun, 5 Nov 2023 11:37:42 -0500 Subject: [PATCH] fix(port): work around GCC false positive warning GCC thinks that Memory_Resource::do_try_grow_in_place should be declared 'final', but it is overwritten by Linked_Bump_Allocator. Ignore GCC's false -Wsuggest-final-methods warning. After fixing -Wsuggest-final-methods, GCC decides to report that the entire Memory_Resource class can be marked final. Ignore this false -Wsuggest-final-types warning as well. --- src/quick-lint-js/port/memory-resource.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/quick-lint-js/port/memory-resource.h b/src/quick-lint-js/port/memory-resource.h index 05c0b6f186..51d8083233 100644 --- a/src/quick-lint-js/port/memory-resource.h +++ b/src/quick-lint-js/port/memory-resource.h @@ -8,9 +8,14 @@ #include #include #include +#include #include #include +QLJS_WARNING_PUSH +QLJS_WARNING_IGNORE_GCC("-Wsuggest-final-methods") +QLJS_WARNING_IGNORE_GCC("-Wsuggest-final-types") + namespace quick_lint_js { // Like std::pmr::memory_resource. // @@ -122,6 +127,8 @@ class Memory_Resource { Memory_Resource* new_delete_resource(); } +QLJS_WARNING_POP + // quick-lint-js finds bugs in JavaScript programs. // Copyright (C) 2020 Matthew "strager" Glazar //