Skip to content

[clang-tidy]llvm-header-guard false positive on #pragma once header #111475

@mzyKi

Description

@mzyKi

a.hpp

#pragma once
int i = 0;

test.cpp

#include "a.hpp"

Result

$ clang-tidy -checks=-*,llvm-header-guard test.cpp -header-filter=.*
a.hpp:1:1: warning: header is missing header guard [llvm-header-guard]
#pragma once
^

I think this check may give one inaccurate note here. Is it necessary to make changes to this situation? I want some suggestion about revising llvm-header-guard. Do not report this bug or give another note? I am willing to fix this. @PiotrZSL Thanks for your suggestion!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions