Skip to content

[BUG] Empty template argument list is ill-formed #469

Closed

Description

@JohelEGP

Title: Empty template argument list is ill-formed.

Description:

Despite the grammar allowing it:

//G template-id:
//G     identifier '<' template-argument-list? '>'

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

main: () = { std::plus<>(); }
Commands:
cppfront -clean-cpp1 main.cpp2
clang++17 -std=c++2b -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . main.cpp

Expected result:

A well-formed program.

Actual result and error:

Output.

main.cpp2...

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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