DMD 2.100, bring ont he attribute soup

deadalnix deadalnix at gmail.com
Fri May 27 21:07:17 UTC 2022


On Friday, 27 May 2022 at 07:06:08 UTC, Per Nordlöw wrote:
> On Thursday, 26 May 2022 at 14:35:57 UTC, deadalnix wrote:
>> Fantastic. Every single one of them is a false positive so 
>> far. I now face the situation where I will have deprecation 
>> warning forever, or add attribute soup to the program.
>
> Can you briefly highlight what those false positives are?
>

It's typically complaining about accessors, because reference to 
member escape. And yes, i know, this is exactly the point of the 
accessor.

>> I'd be happy to add attributes for something that could 
>> actually track ownership/lifetime. DIP1000 is not that. Adding 
>> attributes for that is not worth it.
>
> Would having attributes be inferred for non-templated functions 
> alleviate some these problems? Or isn't that possible because a 
> definition might have forward declarations with qualifiers 
> needing to be in sync with the definition?

Maybe. In the case of trivial accessors, I assume that it would. 
Nevertheless, that would not convince me that DIP1000 is the 
right path forward, because that wouldn't be super useful to me.

Consider that the accessors can be used on objects on the heap as 
much as objects on the stack. DIP1000 is therefore unable to make 
these accessors safe, simply make it so in a very limited set of 
circumstances. This is simply not good enough to justify breaking 
anything.

It would be useful in a static analyzer.


More information about the Digitalmars-d mailing list