The overload of the constructor will repeatedly fix the member variables that need to be initialized.
Removed the duplicate '{}'.
struct A { A() {} A(int) {} int _var; // int _var{}{}; <-- wrong fix };
Paths
| Differential D107641
[clang-tidy] fix duplicate '{}' in cppcoreguidelines-pro-type-member-init ClosedPublic Authored by Sockke on Aug 6 2021, 6:18 AM.
Details Summary The overload of the constructor will repeatedly fix the member variables that need to be initialized. struct A { A() {} A(int) {} int _var; // int _var{}{}; <-- wrong fix };
Diff Detail
Event TimelineHerald added subscribers: shchenz, rnkovacs, kbarton and 2 others. · View Herald TranscriptAug 6 2021, 6:18 AM
This revision is now accepted and ready to land.Aug 12 2021, 4:29 AM Closed by commit rG1f2d40c47f5f: [clang-tidy] fix duplicate '{}' in cppcoreguidelines-pro-type-member-init (authored by Sockke, committed by MTC). · Explain WhyAug 13 2021, 9:13 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 366390 clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.h
clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-pro-type-member-init.cpp
|