Skip to content
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

[BUG] Contract after unnamed declaration fails #537

Closed
JohelEGP opened this issue Jul 7, 2023 · 1 comment
Closed

[BUG] Contract after unnamed declaration fails #537

JohelEGP opened this issue Jul 7, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JohelEGP
Copy link
Contributor

JohelEGP commented Jul 7, 2023

Title: Contract after unnamed declaration fails.

Description: May be related to #356.

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

main: () = {
  _ = :i32 = 0;
  [[assert: true]]
}
Commands:
cppfront main.cpp2
clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -I . main.cpp

Expected result: Same as using i32(0) instead of :i32 = 0.

Actual result and error:

<source>...

example.cpp2(3,4): error: subscript expression [ ] must not be empty (if you were trying to name a C-style array type, use 'std::array' instead) (at '[')

Compiler returned: 1
@JohelEGP
Copy link
Contributor Author

Doesn't reproduce since commit a812dcc.

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

No branches or pull requests

1 participant