Skip to content

Commit 7cc6342

Browse files
junjieqimeta-codesync[bot]
authored andcommitted
Suppress unused static constexpr variable warnings (#5087)
Summary: Pull Request resolved: #5087 Fix 2 `clang-diagnostic-unused-const-variable` lint warnings by adding `[[maybe_unused]]` to `static constexpr int impl` in `IndexIVFPQFastScan.cpp` and `IndexIVFRaBitQFastScan.cpp`. The variable serves as documentation about the search implementation being used, so it is kept rather than removed. Reviewed By: mnorris11 Differential Revision: D100575853 fbshipit-source-id: 1c42958b1de1b663dc8f2eadfff345d27583b8a2
1 parent 48d2b0c commit 7cc6342

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

faiss/IndexIVFPQFastScan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ namespace {
319319

320320
struct IVFPQFastScanScanner : InvertedListScanner {
321321
using InvertedListScanner::scan_codes;
322-
static constexpr int impl = 10; // based on search_implem_10
322+
[[maybe_unused]] static constexpr int impl =
323+
10; // based on search_implem_10
323324
static constexpr size_t nq = 1; // 1 query at a time.
324325
const IndexIVFPQFastScan& index;
325326
AlignedTable<uint8_t> dis_tables;

faiss/IndexIVFRaBitQFastScan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ namespace {
573573
/// Provides IVF scanner interface using FastScan's SIMD batch processing.
574574
struct IVFRaBitQFastScanScanner : InvertedListScanner {
575575
using InvertedListScanner::scan_codes;
576-
static constexpr int impl = 10;
576+
[[maybe_unused]] static constexpr int impl = 10;
577577
static constexpr size_t nq = 1;
578578

579579
const IndexIVFRaBitQFastScan& index;

0 commit comments

Comments
 (0)