codinuum/cca

cpp parser: declaration at the end of function bodies

Closed this issue · 2 comments

Hello and thanks again for your amazing project.

I've noticed a strange AST for the following code:

struct Foo {
  Foo(int b) {}
};
void bar() {
  Foo f(1);
}

The declaration of f is split into StatementMacro:Foo and function-call f(1). But if I add return statement after the declaration:

struct Foo {
  Foo(int b) {}
};
void bar() {
  Foo f(1);
  return;
}

The AST looks as expected.

Thank you for reporting!
We have just fixed the cpp parser.

And thank you for fixing it so fast.