summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2021-05-30 23:20:04 +0300
committerAndreas Kling <kling@serenityos.org>2021-06-01 22:20:13 +0200
commitb5da0b71e51994bac5dad46c5cc3e6a80da87a00 (patch)
tree872cb3f1637c83cdbfee213097a0feaa5b41bf49
parentab79599a5ef01ea4015731e01c0348b6b7de0024 (diff)
downloadserenity-b5da0b71e51994bac5dad46c5cc3e6a80da87a00.zip
LibCpp: Consider declarations inside a function's body
... in FunctionDeclaration::declarations()
-rw-r--r--Userland/Libraries/LibCpp/AST.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibCpp/AST.cpp b/Userland/Libraries/LibCpp/AST.cpp
index 8fb5cc52cd..344858d7e0 100644
--- a/Userland/Libraries/LibCpp/AST.cpp
+++ b/Userland/Libraries/LibCpp/AST.cpp
@@ -61,6 +61,10 @@ NonnullRefPtrVector<Declaration> FunctionDeclaration::declarations() const
for (auto& arg : m_parameters) {
declarations.append(arg);
}
+
+ if (m_definition)
+ declarations.append(m_definition->declarations());
+
return declarations;
}