[PATCH] D142123: [clang-tidy] Add check to suggest use of #pragma once

Kyle Edwards via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 19 10:57:43 PST 2023


KyleFromKitware added a comment.

In terms of a "generic check", there is already the `HeaderGuardCheck`, but that has to be extended to be specific to the project's naming convention. And I don't think there can be a generic check that converts `#pragma once` to a header guard - when it adds the header guard, what does it name it? It has to know the project's naming convention. If we want a check that replaces `#pragma once` with a header guard, our best bet would be modifying `HeaderGuardCheck` to do this, since it already does most of the needed work. However, such functionality is orthogonal to my proposal here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142123/new/

https://reviews.llvm.org/D142123



More information about the cfe-commits mailing list