Skip to content

[[clang::lifetimebound]] doesn't work with default arguments #68596

@higher-performance

Description

@higher-performance
const int& foo(const int& x [[clang::lifetimebound]] = 0) {
    return x;
}
int main() {
    const int& x = foo();  // No error
    return x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"clang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions