-
Notifications
You must be signed in to change notification settings - Fork 4
Fix std::ref(i) with std::reference_wrapper #51
Comments
I will look into that as soon as we are done with Richard's request :) I was actually investigating this when I noticed the other problem. |
I'm not sure if we can fix this without having the |
We have
Here the parameter The same applies to the std::reference_wrapper constructor. We figured out that we don't want to automatically infer It's true that when we have a DerefType, the automatic function annotations inference would come to the same conclusion. Separately, we might need to annotate that |
Yeah, I see that. But in this sense |
To give a bit more context, the reason why is it not easy to add a separate code path currently: |
Ok, I didn't know that. That seems to imply that we cannot support std::ref (right now), correct? I tried to formulate explicit annotations on both functions, and now I'm a bit confused about our annotations syntax. What I initially came up with is
i.e. the same written contract in both cases, but meaning different things:
|
Yeah, unfortunately. There might be a way to make it work though, but it needs more thought. For your question, as far as I remember, the answer is yes. Last time we agreed on the reference meaning the pset of the top level thing and we need to use deref to get the pset of the pointee. An alternative would be to use |
See
in
test/Sema/warn-lifetime-analysis-nocfg.cpp
.fyi @Xazax-hun
The text was updated successfully, but these errors were encountered: