llvm/llvm-project

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

Open

#166.750 aberto em 6 de nov. de 2025

Ver no GitHub
 (10 comments) (0 reactions) (1 assignee)C++ (10.782 forks)batch import
clang-tidyfalse-positivegood first issue

Métricas do repositório

Stars
 (26.378 stars)
Métricas de merge de PR
 (Mesclagem média 1d 2h) (1.000 fundiu PRs em 30d)

Description

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.

Guia do colaborador