1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:57:47 +00:00

Libraries/LibCpp: Add parser test for out-of-line function definitions

This commit is contained in:
Itamar 2022-02-22 20:17:43 +02:00 committed by Linus Groh
parent cdfc530a99
commit 610b380515
2 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,21 @@
TranslationUnit[2:0->9:0]
StructOrClassDeclaration[2:6->7:0]
A
FunctionDeclaration[4:4->4:14]
NamedType[4:4->4:7]
bool
foo
(
)
FunctionDeclaration[7:0->9:0]
NamedType[7:0->7:3]
bool
A::foo
(
)
FunctionDefinition[7:14->9:0]
{
ReturnStatement[8:4->8:15]
BooleanLiteral[8:11->8:14]
true
}

View file

@ -0,0 +1,10 @@
class A
{
bool foo();
};
bool A::foo() {
return true;
}