From 12a900b97cb37e3e67ab5590b29dafa29eee9259 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sat, 17 Jun 2023 22:41:56 +0330 Subject: [PATCH] LibCpp: Ignore the #error preprocessor directive --- Userland/Libraries/LibCpp/Preprocessor.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/Libraries/LibCpp/Preprocessor.cpp b/Userland/Libraries/LibCpp/Preprocessor.cpp index 128b215b158..8316be3f3ca 100644 --- a/Userland/Libraries/LibCpp/Preprocessor.cpp +++ b/Userland/Libraries/LibCpp/Preprocessor.cpp @@ -230,6 +230,10 @@ void Preprocessor::handle_preprocessor_keyword(StringView keyword, GenericLexer& line_lexer.consume_all(); return; } + if (keyword == "error") { + line_lexer.consume_all(); + return; + } if (!m_options.ignore_unsupported_keywords) { dbgln("Unsupported preprocessor keyword: {}", keyword);