diff options
author | Itamar <itamar8910@gmail.com> | 2021-08-06 11:15:57 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-07 21:24:11 +0200 |
commit | 0c4dc00f01aa283e08bb04a6e10f9bc6627bdb25 (patch) | |
tree | 9a710bce75a66a44276340c17bd0fe1e164b4a5e /Userland/Libraries/LibCpp/Parser.h | |
parent | 4673a517f6223558b17809216acc57f03b6889bd (diff) | |
download | serenity-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.h')
-rw-r--r-- | Userland/Libraries/LibCpp/Parser.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.h b/Userland/Libraries/LibCpp/Parser.h index b21eca15bc..34e70bd7a6 100644 --- a/Userland/Libraries/LibCpp/Parser.h +++ b/Userland/Libraries/LibCpp/Parser.h @@ -18,7 +18,7 @@ class Parser final { AK_MAKE_NONCOPYABLE(Parser); public: - explicit Parser(Vector<Token> const& tokens, const String& filename, Preprocessor::Definitions&& = {}); + explicit Parser(Vector<Token> const& tokens, const String& filename, Preprocessor::Definitions const& = {}); ~Parser() = default; NonnullRefPtr<TranslationUnit> parse(); |