Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Allow adding const to function parameter in definition #346

Closed
Tracked by #349
jyn514 opened this issue Mar 15, 2020 · 0 comments
Closed
Tracked by #349

Allow adding const to function parameter in definition #346

jyn514 opened this issue Mar 15, 2020 · 0 comments
Labels
bug Something isn't working parser Issue to do with parsing the abstract syntax tree

Comments

@jyn514
Copy link
Owner

jyn514 commented Mar 15, 2020

Expected behavior

Adding const to a function parameter in the definition should be legal and mark that parameter as const for the duration of the body.

Code

int f(int i);    
int f(const int i) { return i; }
<stdin>:2:6 error: invalid program: redeclaration of 'f' with different type or qualifiers (originally extern int f(int i), now extern int f(int i))

C Standard

Not sure. Possibly relevant:

@jyn514 jyn514 added bug Something isn't working parser Issue to do with parsing the abstract syntax tree labels Mar 15, 2020
@jyn514 jyn514 closed this as completed May 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working parser Issue to do with parsing the abstract syntax tree
Projects
None yet
Development

No branches or pull requests

1 participant