Skip to content

[BUG] Digit separator doesn't parse #862

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 Dec 2, 2023 · 2 comments
Closed

[BUG] Digit separator doesn't parse #862

JohelEGP opened this issue Dec 2, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@JohelEGP
Copy link
Contributor

JohelEGP commented Dec 2, 2023

Title: Digit separator doesn't parse.

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

niam: () = { _ = 0'1; } // Not OK.
main: () = {
  _ = 0'1; // OK
}
Commands:
cppfront main.cpp2
clang++18 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -Werror=unused-value -Werror=unused-parameter -I . main.cpp

Expected result: Both to work.

Actual result and error:

main.cpp2...
main.cpp2(5,0): error: end of file reached with 1 missing } to match earlier { on line 1
@ntrel
Copy link
Contributor

ntrel commented Dec 8, 2023

This causes the same error:

  if 1 { _ = 0'1; }

Seems to be caused by this line:

break;case '\'':

@hsutter
Copy link
Owner

hsutter commented Dec 14, 2023

Yup, that was the offending line. Thanks!

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.

3 participants