Date: Wed, 23 Jul 2025 08:41:35 +0100
https://godbolt.org/z/Yaonb86xP
On Tue, Jul 22, 2025 at 10:37 PM Aurelien Cassagnes
<aurelien.cassagnes_at_[hidden]> wrote:
>
> https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
> …
>
> Sent from Gmail Mobile
>
>
> On Wed, Jul 23, 2025 at 0:27 Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> wrote:
>>
>> On Tue, Jul 22, 2025 at 4:23 PM Frederick Virchanza Gotham wrote:
>> >
>> > "When applied to a class's method, the [[lifetimebound]] attribute
>> > indicates that the invocation of the method on an object of the class
>> > will return a value which is only valid for the lifetime of the
>> > aforementioned object. Therefore where possible, the compiler shall
>> > issue a diagnostic if it detects the use of the return value after the
>> > aforementioned object has been destroyed."
>>
>>
>> And even if compiler vendors say it's too much grief to implement . .
>> . maybe it will make it into 'cppcheck'
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
On Tue, Jul 22, 2025 at 10:37 PM Aurelien Cassagnes
<aurelien.cassagnes_at_[hidden]> wrote:
>
> https://clang.llvm.org/docs/AttributeReference.html#lifetimebound
> …
>
> Sent from Gmail Mobile
>
>
> On Wed, Jul 23, 2025 at 0:27 Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> wrote:
>>
>> On Tue, Jul 22, 2025 at 4:23 PM Frederick Virchanza Gotham wrote:
>> >
>> > "When applied to a class's method, the [[lifetimebound]] attribute
>> > indicates that the invocation of the method on an object of the class
>> > will return a value which is only valid for the lifetime of the
>> > aforementioned object. Therefore where possible, the compiler shall
>> > issue a diagnostic if it detects the use of the return value after the
>> > aforementioned object has been destroyed."
>>
>>
>> And even if compiler vendors say it's too much grief to implement . .
>> . maybe it will make it into 'cppcheck'
>> --
>> Std-Proposals mailing list
>> Std-Proposals_at_[hidden]
>> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-07-23 07:41:50