LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 49318 - cppcoreguidlines-prefer-member-initializer is unusable in release branch
Summary: cppcoreguidlines-prefer-member-initializer is unusable in release branch
Status: RESOLVED FIXED
Alias: None
Product: clang-tools-extra
Classification: Unclassified
Component: clang-tidy (show other bugs)
Version: unspecified
Hardware: PC Linux
: P enhancement
Assignee: Alexander Kornienko
URL:
Keywords:
Depends on:
Blocks: release-12.0.0
  Show dependency tree
 
Reported: 2021-02-22 12:17 PST by Nathan James
Modified: 2021-02-22 16:34 PST (History)
5 users (show)

See Also:
Fixed By Commit(s):


Attachments
RemovePreferMemberInitializerCheck (45.40 KB, patch)
2021-02-22 13:07 PST, Nathan James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan James 2021-02-22 12:17:09 PST
This check has a lot of issue. It crashes with some macros - see here https://bugs.llvm.org/show_bug.cgi?id=47778 and a lot of fixes it suggests result in malformed code. I pushed a fix addressing the crashing as well as providing much more robust fixes(https://github.com/llvm/llvm-project/commit/a2e15fa532f36db7080347fbae31470c8ceaffc4).
These fixes haven't had enough real world testing to justify backporting to the release, nor is the current release version really ready to stay in. I suggest patching out the check from the 12 branch in favour of introducing it in the 13 branch.
Discussed with Aaron Ballman and he suggested this was probably a favourable approach.
Comment 1 Aaron Ballman 2021-02-22 12:20:20 PST
FWIW, I think it's slightly preferred to back the check out of 12 instead of patching it at this late stage or leaving a known low-quality new check in the release.
Comment 2 Tom Stellard 2021-02-22 12:46:14 PST
Can you submit a patch to remove the check?
Comment 3 Nathan James 2021-02-22 12:55:33 PST
It may be a pain to submit a patch to remove it on the 13 branch, Is it easier to write a patch for the current 12 branch.
Comment 4 Nathan James 2021-02-22 13:07:14 PST
Created attachment 24561 [details]
RemovePreferMemberInitializerCheck

This should apply on the release/12.X branch cleanly and remove the check and all related docs and tests
Comment 5 Tom Stellard 2021-02-22 16:34:26 PST
Merged: a750a2329c433e598f7fc9655d625c5ebb6bc400