llvm/llvm-project

[clang-tidy] llvm-header-guard suggest invalid ifdef macros name

Open

#166.750 aperta il 6 nov 2025

Vedi su GitHub
 (10 commenti) (0 reazioni) (1 assegnatario)C++ (10.782 fork)batch import
clang-tidyfalse-positivegood first issue

Metriche repository

Star
 (26.378 star)
Metriche merge PR
 (Merge medio 1g 2h) (1000 PR mergiate in 30 g)

Descrizione

When https://clang.llvm.org/extra/clang-tidy/checks/llvm/header-guard.html check sees a file with has "llvm" inside its filepath (e.g. clang-tools-extra/clang-tidy/llvm/HeaderGuardCheck.h), instead of making such ifdef:

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_LLVM_HEADERGUARDCHECK_H

The check makes:

#ifndef LLVM_HEADERGUARDCHECK_H

The check removes leading part if sees "LLVM" in check-name which is incorrect.

Guida contributor