diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 924a7e69798b9d..ba55174c848413 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -1497,7 +1497,7 @@ bool Preprocessor::enterOrExitSafeBufferOptOutRegion( // To set the start location of a new region: if (!SafeBufferOptOutMap.empty()) { - auto *PrevRegion = &SafeBufferOptOutMap.back(); + [[maybe_unused]] auto *PrevRegion = &SafeBufferOptOutMap.back(); assert(PrevRegion->first != PrevRegion->second && "Shall not begin a safe buffer opt-out region before closing the " "previous one.");