Page MenuHomePhabricator

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

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

Details

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.Mon, Jan 17, 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.Mon, Jan 17, 1:44 PM