Patterns in extern function declarations are parseable but should be checked for
Open
Nobody has claimed this yet.
bug
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 231
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 67
Description
I tried this code:
struct Pattern(i32);
extern "C" {
fn foo(Pattern(a): Pattern);
}
I expected to see this happen: parsing should succeed, but an AST validation pass should fail: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c69d76225d2af005f0441b34b96e5a2a
Instead, this happened: gccrs failed during the parsing step
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Rust reproducer in the issue and compare gccrs behavior with the linked Rust Playground result. Trace the extern function declaration through parsing and AST validation, then verify that parsing succeeds while validation rejects the pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100