Skip to content

Commit

Permalink
[cling] Fix build with assertions
Browse files Browse the repository at this point in the history
Fixes commit 68769cd ("[cling] Move parts of Parse to another
function").
  • Loading branch information
hahnjo committed May 7, 2024
1 parent 7b01e76 commit 87a1af5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions interpreter/cling/lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 87a1af5

Please sign in to comment.