[clang-tools-extra] [llvm] New check `misc-header-guard` (PR #177315)

via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 26 07:56:34 PST 2026


EugeneZelenko wrote:

> > I think check also should look for #pragma once.
> 
> Good idea! I will continue with it next week 👍🏻
> 
> @EugeneZelenko Can you please guide me how you would do this?

I think there are two scenarios:

* Warn about conflicting `#pragma once` and do not insert guard.
* Replace `#pragma once` with guard.

I'm not sure with one is easier to implement, but later seems more fitting check purpose.

https://github.com/llvm/llvm-project/pull/177315


More information about the cfe-commits mailing list