Rust-GCC / Rust-GCC/gccrs

Patterns in extern function declarations are parseable but should be checked for

Open
#2,732 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.