Skip to content

[Clang] __builtin_assume_dereferenceable should be constexpr #168335

@philnik777

Description

@philnik777

Currently __builtin_assume_dereferenceable isn't constexpr. I don't think there is a fundamental problem with constant evaluating it though. It should be possible to check whether, from a certain pointer, there are indeed N bytes that can be dereferenced. The compiler has to do that anyways AFAICT, since out of bounds accesses need to be diagnosed during constant evaluation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions