Skip to content

[BUG] Non-empty line after one-liner type with requires clause fails assertion #472

Closed
@JohelEGP

Description

@JohelEGP

Title: Non-empty line after one-liner type with requires clause fails assertion.

Minimal reproducer (https://cpp2.godbolt.org/z/bfh5bfTj4):

t: type requires true = { }
main: () = { }
Commands:
cppfront -clean-cpp1 main.cpp2

Actual result and error:

Output.

cppfront: source/cppfront.cpp:523: void cpp2::positional_printer::align_to(cpp2::source_position): Assertion `psource && 0 <= curr_pos.lineno && curr_pos.lineno < std::ssize(psource->get_lines())+1' failed.

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