Suppress unused static constexpr variable warnings (#5087)

Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/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
This commit is contained in:
Junjie Qi
2026-04-13 12:23:12 -07:00
committed by meta-codesync[bot]
parent 48d2b0c946
commit 7cc63422d7
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -319,7 +319,8 @@ namespace {
struct IVFPQFastScanScanner : InvertedListScanner {
using InvertedListScanner::scan_codes;
static constexpr int impl = 10; // based on search_implem_10
[[maybe_unused]] static constexpr int impl =
10; // based on search_implem_10
static constexpr size_t nq = 1; // 1 query at a time.
const IndexIVFPQFastScan& index;
AlignedTable<uint8_t> dis_tables;
+1 -1
View File
@@ -573,7 +573,7 @@ namespace {
/// Provides IVF scanner interface using FastScan's SIMD batch processing.
struct IVFRaBitQFastScanScanner : InvertedListScanner {
using InvertedListScanner::scan_codes;
static constexpr int impl = 10;
[[maybe_unused]] static constexpr int impl = 10;
static constexpr size_t nq = 1;
const IndexIVFRaBitQFastScan& index;