Skip to content

[[clang::lifetimebound]] is ignored without warning if the function parameter doesn't have a name. #96034

Open
@hokein

Description

@hokein

See the example:

int* good(const int& abc[[clang::lifetimebound]]);

int* bad(const int& [[clang::lifetimebound]]);

The AST looks like:

-FunctionDecl  ... good 'int *(const int &)'
| `-ParmVarDecl ... abc 'const int &'
|   `-LifetimeBoundAttr 
`-FunctionDecl ... bad 'int *(const int &)'
  `-ParmVarDecl ... 'const int &'

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"clang:memory-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