ymandel accepted this revision.
ymandel added inline comments.
================
Comment at: 
clang/lib/Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel.cpp:264
+          +[](const CXXMemberCallExpr *E, LatticeTransferState &State) {
+            assignOptionalValue(*E->getImplicitObjectArgument(), State,
+                                State.Env.getBoolLiteralValue(true));
----------------
sgatev wrote:
> ymandel wrote:
> > I realize this is consistent with the previous version, but just noticed 
> > this issue. By using `assignOptionalValue` for `emplace` (and `reset`), 
> > does that break the following case?
> > 
> > ```
> > optional<int> opt;
> > if (p) opt.emplace(3);
> > someCode();
> > if (p) use(*opt);
> > ```
> This isn't supported yet. Still, I don't think `assignOptionalValue` breaks 
> it because this seems more related to the way information from different 
> branches is joined than the way values are initialized. I'll add this case 
> (and others) in a following patch that adds support for joining.
Sounds good. I think we can discuss further in the next patch as needed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121602/new/

https://reviews.llvm.org/D121602

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to