Skip to content

Unsafe buffer usage: calls to [[clang::unsafe_buffer_usage]] constructors are not warned on #80482

Open
@danakj

Description

@danakj

[[clang::unsafe_buffer_usage]] should be applied to any function which can cause OOB when given invalid inputs. However if a constructor is marked unsafe, calls to it do not cause a warning to be generated.

This prevents us from requiring annotations on dangerous constructor calls, such as those types like span.

https://godbolt.org/z/debqW3ahx

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions