Skip to content

assume_aligned incorrectly diagnoses a dependent return type #111563

@AaronBallman

Description

@AaronBallman

Consider:

template<typename T>
__attribute__((assume_aligned(2)))
T my_alloc(int);

(https://godbolt.org/z/EGebP7o8n)

Clang issues a diagnostic about the return type not being a pointer type despite there being no instantiations. It seems we need to add if T->isDependentType() return true; to isValidPointerAttrType(), possibly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"good first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions