microsoft / microsoft/vscode-cpptools
C23 auto type inference support
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
C standard is set to c23 in extension settings.
In C23 standard the auto keyword allows type inference doing pretty much the same job as __auto_type GNU extension. The latter is supported by your extension and if I hover my mouse over declared variable I see that the type is infered correctly.
But if I change __auto_type to auto an error is yield:
This code compiles and works correctly with -std=c2x flag.
Since __auto_type is already supported, can auto behave the same way if C standard parameter is set to c23?
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
Reproduce the issue with the C standard setting set to c23, comparing the auto and __auto_type declarations and their hover results against a build using -std=c2x. Done means the extension accepts C23 auto, reports no incorrect error, and infers the declared variable's type correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100