summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCpp/Parser.cpp
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-08-06 11:15:57 +0300
committerAndreas Kling <kling@serenityos.org>2021-08-07 21:24:11 +0200
commit0c4dc00f01aa283e08bb04a6e10f9bc6627bdb25 (patch)
tree9a710bce75a66a44276340c17bd0fe1e164b4a5e /Userland/Libraries/LibCpp/Parser.cpp
parent4673a517f6223558b17809216acc57f03b6889bd (diff)
downloadserenity-0c4dc00f01aa283e08bb04a6e10f9bc6627bdb25.zip
LibCpp: Import definitions from headers while processing
When the preprocessor encounters an #include statement it now adds the preprocessor definitions that exist in the included header to its own set of definitions. We previously only aggregated the definitions from headers after processing the source, which was less correct. (For example, there could be an #ifdef that depends on a definition from another header).
Diffstat (limited to 'Userland/Libraries/LibCpp/Parser.cpp')
-rw-r--r--Userland/Libraries/LibCpp/Parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp
index da0d479fda..4bcc5ecd67 100644
--- a/Userland/Libraries/LibCpp/Parser.cpp
+++ b/Userland/Libraries/LibCpp/Parser.cpp
@@ -15,7 +15,7 @@
namespace Cpp {
-Parser::Parser(Vector<Token> const& tokens, const String& filename, Preprocessor::Definitions&& definitions)
+Parser::Parser(Vector<Token> const& tokens, const String& filename, Preprocessor::Definitions const& definitions)
: m_preprocessor_definitions(move(definitions))
, m_filename(filename)
{