Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JohelEGP opened this issue May 25, 2023 · 0 comments · Fixed by #473
Closed

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

JohelEGP opened this issue May 25, 2023 · 0 comments · Fixed by #473
Labels
bug Something isn't working

Comments

@JohelEGP
Copy link
Contributor

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant