Skip to content

[clang-tidy] [With reproducible example] Erroneous rule "llvm-header-guard" since v21.0.0 #164417

@Spixmaster

Description

@Spixmaster

All my header guards raise issues now which never was the case before. The following example file is called constant.hpp. See the warning in line 2.

#ifndef CONSTANT_HPP
#define CONSTANT_HPP //code/includes outside of area guarded by header guard; consider moving it [llvm-header-guard]

#include <string>

namespace constant
{
    //Variables
    /**
     * @var name
     * @brief Programme name.
     */
    extern const std::string name;
    /**
     * @var release
     * @brief Release date of the version.
     */
    extern const std::string release;
    /**
     * @var version
     * @brief Version.
     */
    extern const std::string version;

    //Functions
    /**
     * @brief Creates the programme name in lower case.
     * @return Programme name in lower case.
     */
    std::string name_lower_case();
} //namespace constant

#endif

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions