Skip to content

[BUG] Wrong location for ill formed definitions #488

Closed
@MaxSagebaum

Description

@MaxSagebaum

Title: Wrong location for ill formed definitions

Description:

A wrong definition like int a = 4; should be reported with the correct line.

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

func: () = {
    a : int = 5;
    int b = 4;
    c: int = 3;
}

Commands:

cppfront main.cpp2 -o main.cpp

Expected result:

main.cpp2(3,12): error: ill-formed initializer (at ' int b = 4;')
main.cpp2(1,1): error: unexpected text at end of Cpp2 code section (at 'func')
main.cpp2(1,0): error: parse failed for section starting here

Actual result and error:

main.cpp2(1,12): error: ill-formed initializer (at '{')
main.cpp2(1,1): error: unexpected text at end of Cpp2 code section (at 'func')
main.cpp2(1,0): error: parse failed for section starting here

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