[clang-tidy] Extend modernize-use-designated-initializers to cover per-member initialization
Open
clang-tidy
enhancement
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
~~~c++
struct S {
int a;
int b;
};
S f() {
S s;
s.a = 0;
s.b = 1;
//S s{ .a = 0, .b = 1 }; // fix-it
return s;
}
~~~
https://godbolt.org/z/rGvrzasYn
Contributor guide
Research direction
Start by locating the clang-tidy modernize-use-designated-initializers check and its existing tests. Compare the shown per-member assignments with the check's current supported cases; done means it emits the requested designated-initializer fix-it for this pattern and tests cover it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100