From 65a2a778d17988d84ad864a3870f98f4e72c1866 Mon Sep 17 00:00:00 2001 From: Jonas Hahnfeld Date: Tue, 7 May 2024 09:43:46 +0200 Subject: [PATCH] Fix build with assertions Fixes commit 68769cd980 ("[cling] Move parts of Parse to another function"). --- lib/Interpreter/IncrementalParser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Interpreter/IncrementalParser.cpp b/lib/Interpreter/IncrementalParser.cpp index 7a522bd1..8f7adb2a 100644 --- a/lib/Interpreter/IncrementalParser.cpp +++ b/lib/Interpreter/IncrementalParser.cpp @@ -976,11 +976,15 @@ namespace cling { } if (CO.CodeCompletionOffset != -1) { +#ifndef NDEBUG + Preprocessor& PP = m_CI->getPreprocessor(); + SourceManager& SM = getCI()->getSourceManager(); assert((int)SM.getFileOffset(PP.getCodeCompletionLoc()) == CO.CodeCompletionOffset && "Completion point wrongly set!"); assert(PP.isCodeCompletionReached() && "Code completion set but not reached!"); +#endif // Let's ignore this transaction: m_Consumer->getTransaction()->setIssuedDiags(Transaction::kErrors);