This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Warn about arrays in `bugprone-undefined-memory-manipulation`
ClosedPublic

Authored by fwolff on Jun 3 2022, 4:54 PM.

Diff Detail

Event Timeline

fwolff created this revision.Jun 3 2022, 4:54 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 3 2022, 4:54 PM
fwolff requested review of this revision.Jun 3 2022, 4:54 PM
JonasToth added inline comments.
clang-tools-extra/clang-tidy/bugprone/UndefinedMemoryManipulationCheck.cpp
27–34

you can factor the hasDeclaration(cxxRecordDecl(isNotTriviallyCopyable())) out to avoid the copy&paste.

clang-tools-extra/test/clang-tidy/checkers/bugprone-undefined-memory-manipulation.cpp
129

could you please add a test with a typedef to array to ensure that those are matched as well.

fwolff updated this revision to Diff 434283.Jun 4 2022, 12:24 PM
fwolff marked 2 inline comments as done.
LegalizeAdulthood requested changes to this revision.Jun 22 2022, 2:11 PM

Clang-Tidy tests and docs have moved to module subdirectories.

Please rebase this onto main:HEAD and:

  • fold your changes into the appropriate subdirs, stripping the module prefix from new files.
  • make the target check-clang-extra to validate your tests
  • make the target docs-clang-tools-html to validate any docs changes
This revision now requires changes to proceed.Jun 22 2022, 2:11 PM
LegalizeAdulthood resigned from this revision.Mar 29 2023, 8:49 AM
This revision now requires review to proceed.Mar 29 2023, 8:49 AM
PiotrZSL accepted this revision.Sep 20 2023, 11:56 AM

LGTM, I will rebase, push it and add release notes.

This revision is now accepted and ready to land.Sep 20 2023, 11:56 AM