Skip to content

[BUG] Contract after simple expression function fails #356

Closed
@JohelEGP

Description

@JohelEGP

It works with an extra ;, if the expression function has a compound-statement, or with a statement in-between.

Minimal reproducer (https://godbolt.org/z/TfajzxMT1):

main: () = {
  :() = 1;
  [[assert: 1]]
}

Commands:

cppfront x.cpp2

Expected result: The same as any of the first two workarounds above.

Actual result and error:

main.cpp2(3,4): error: subscript expression [ ] must not be empty (if you were trying to name a C-style array type, use 'std::array' instead) (at '[')

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions