Skip to content

[[clang::lifetimebound]] is ignored in some cases when declaration and definition do not apply the attribute consistently #175391

Description

@ddkilzer

[[clang::lifetimebound]] is ignored in some cases when declaration and definition do not apply the attribute consistently.

The [[clang::lifetimebound]] attribute on a method's implicit object parameter (the this pointer) is not properly detected when:

  1. A non-template or specialized-template method declaration had the attribute but the out-of-line definition did not
  2. A template method out-of-line definition had the attribute but the declaration did not

The Godbolt test should show 9 -Wdangling warnings, but currently only shows 6 warnings: https://godbolt.org/z/ra5avj8e4

rdar://167796787

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:temporal-safetyIssue/FR relating to the lifetime analysis in Clang (-Wdangling, -Wreturn-local-addr)false-negativeWarning doesn't fire when it should

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions