This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix `altera-struct-pack-align` check for empty structs
ClosedPublic

Authored by fwolff on Nov 19 2021, 3:15 PM.

Diff Detail

Event Timeline

fwolff created this revision.Nov 19 2021, 3:15 PM
fwolff requested review of this revision.Nov 19 2021, 3:15 PM
whisperity requested changes to this revision.Nov 26 2021, 12:33 AM

I believe this is worth a note in the ReleaseNotes.rst file. People who might have disabled the check specifically for the reason outlined in the PR would get to know it's safe to reenable it.

clang-tools-extra/clang-tidy/altera/StructPackAlignCheck.cpp
81

If we are changing this, can we make this more C++-y?

This revision now requires changes to proceed.Nov 26 2021, 12:33 AM

+1 to the request for a release note, but otherwise this LGTM (with or without the static_cast changes) in general. Should we also do something special for [[no_unique_address]] (if we should, I'm fine doing that in a follow-up)?

fwolff updated this revision to Diff 400634.Jan 17 2022, 1:44 PM

I've added the static_cast and an entry in the release notes. I'm not sure how to handle [[no_unique_address]], so I'd rather leave this to future work.

fwolff marked an inline comment as done.Jan 17 2022, 1:44 PM
whisperity accepted this revision.Apr 19 2022, 2:34 AM

@aaron.ballman Alright, I think this can go. The ReleaseNotes.rst needs a rebase anyway.

This revision is now accepted and ready to land.Apr 19 2022, 2:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2022, 2:34 AM
aaron.ballman accepted this revision.Apr 19 2022, 7:27 AM

Oh, yeah, this fell off my radar. Agreed, LGTM!