Skip to content

[BUG] Pointer type not parsed as template argument #502

Closed
@JohelEGP

Description

@JohelEGP

Title: Pointer type not parsed as template argument.

Description:

See #456 (comment).
It's valid grammar.
I guess the error is being emitted
while parsing the expression production
without regard for the context.

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

main: () = std::is_void_v<* i32>;
Commands:
cppfront -clean-cpp1 main.cpp2
clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . main.cpp

Expected result:

Program returned: 0

Actual result and error:

Output:
main.cpp2(1,27): error: prefix '*ptr' dereference is not valid Cpp2; use postfix 'ptr*' instead

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