summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCpp
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2022-02-05 18:09:11 +0200
committerAndreas Kling <kling@serenityos.org>2022-02-09 00:51:31 +0100
commitae68355a5621c32e906e56be363c8ca6dade5ff1 (patch)
tree6a6b069019162ac13d5621e72b7cea2f6b05339e /Userland/Libraries/LibCpp
parent36aac1479890c1a10c2544fd2b74b581c550ff54 (diff)
downloadserenity-ae68355a5621c32e906e56be363c8ca6dade5ff1.zip
LibCpp: Fix parent of parameter type node
Previously, the parent of a parameter's Type node was incorrectly set to the parent of the Parameter node. We now set the parent of the parameter's Type node to the Parameter node itself.
Diffstat (limited to 'Userland/Libraries/LibCpp')
-rw-r--r--Userland/Libraries/LibCpp/Parser.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp
index 5a75d8e193..60ffd952a2 100644
--- a/Userland/Libraries/LibCpp/Parser.cpp
+++ b/Userland/Libraries/LibCpp/Parser.cpp
@@ -769,6 +769,7 @@ Optional<NonnullRefPtrVector<Parameter>> Parser::parse_parameter_list(ASTNode& p
name = text_of_token(name_identifier.value());
auto param = create_ast_node<Parameter>(parent, type->start(), name_identifier.has_value() ? name_identifier.value().end() : type->end(), name);
+ type->set_parent(*param.ptr());
param->set_type(move(type));
parameters.append(move(param));