Skip to content

Commit

Permalink
fix(port): work around GCC false positive warning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
strager committed Nov 5, 2023
1 parent c61fae6 commit ab8b151
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/quick-lint-js/port/memory-resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
#include <new>
#include <quick-lint-js/port/attribute.h>
#include <quick-lint-js/port/span.h>
#include <quick-lint-js/port/warning.h>
#include <quick-lint-js/util/cast.h>
#include <utility>

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.
//
Expand Down Expand Up @@ -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
//
Expand Down

0 comments on commit ab8b151

Please sign in to comment.