[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:18:03 PST 2023


KyleFromKitware added a comment.

In D142123#4066351 <https://reviews.llvm.org/D142123#4066351>, @njames93 wrote:

> and peoples eagerness to blindly enable all checks (or all checks from a module)

Perhaps there's some way we can have it disabled by default and not enabled unless they explicitly enable it (similar to `-Wall` vs `-Wextra`/`-Weverything`)?

I agree that it should not be standard, but it works in the vast majority of use cases. Drake <https://github.com/RobotLocomotion/drake> is another very large C++ project that uses `#pragma once` everywhere. The demand for `#pragma once` exists, as does the demand for a check to enforce it. If we don't land this in LLVM proper, where would be a better place for it?


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

https://reviews.llvm.org/D142123



More information about the cfe-commits mailing list