Skip to content

Commit

Permalink
fix error handling when parsing invaild code
Browse files Browse the repository at this point in the history
by consuming the Error
  • Loading branch information
Vipul-Cariappa committed Nov 30, 2024
1 parent d9adac0 commit 35c1d0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,8 +911,11 @@ namespace cling {
PP.EnterSourceFile(FID, /*DirLookup*/nullptr, NewLoc);
m_Consumer->getTransaction()->setBufferFID(FID);

if (!ParseOrWrapTopLevelDecl())
llvm::Expected<bool> res = ParseOrWrapTopLevelDecl();
if (!res) {
llvm::consumeError(std::move(res.takeError()));
return kFailed;
}

if (PP.getLangOpts().DelayedTemplateParsing) {
// Microsoft-specific:
Expand Down

0 comments on commit 35c1d0a

Please sign in to comment.