erichkeane wrote:

> Given that there are a bunch of design questions that comes to mind here, 
> notably whether the attribute is on the declaration of the class or the 
> constructor, the impact of move assignment operators, constraints etc and the 
> fact we need more illustration of usage, I would like to see an RFC for that 
> before moving forward with the PR
> 
> @AaronBallman @erichkeane

This is frankly pretty specific, I'm not sure how useful an RFC would be?  That 
said:
--Application: ANYTHING besides on the type decl is probably going to be really 
confusing.  Having to separately attest (and perhaps DIFFERENTLY attest!) based 
on move construction or assignment seems nuts.  While I agree that this is 
something potentially USEFUL (consider a case where a move assignment does a 
'swap', like IIRC 'vector'), it seems very difficult to reason about.

--The attachment to 'default constructed state' seems pretty ethereal and not 
very useful/possible to reason about either.  For general user defined types 
(which, if this is an attribute, we need to make sure this is useful for!), 
this seems very difficult to figure out.  IF all you care about is smart 
pointers, you should just teach your static analyzer what the smart pointer 
semantics are anyway if you're hard coding in their default constructed 
semantics.

-- On that purpose:  I think we need to step back and decide WHAT information 
is useful.  Currently we already have the guarantee of moved-from as "valid but 
unspecified".  WHAT sort of specification is useful?  Actually... I wonder if 
the individual OPERATIONS on the type are what is valuable after move.  Like, 
should the `unique_ptr`'s `operator*` be what we mark with 
`[[can-do-something-with-after-move]]`  (or vice versa?)?  

Maybe we DO need an RFC... Though in order to do so, I think that the above 
stuff needs to be better considered before one is published.



https://github.com/llvm/llvm-project/pull/178432
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to