Skip to content

[clang-tidy] bugprone-unchecked-optional-access allow custom CHECK-like macros #121486

@Jacobfaib

Description

@Jacobfaib

The docs state:

The check is aware of common macros like CHECK and DCHECK. Those can be used to ensure that an optional object has a value. For example:

But not every project uses CHECK or DCHECK. Would be nice if we could tell clang-tidy about our own checking macros (e.g. PROJECT_CHECK).

The alternative is to always silence clang-tidy because it doesn't understand our macros:

PROJECT_CHECK(optional.has_value()); optional->foo(); // NOLINT(bugprone-unchecked-optional-access)

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