NoQ added a comment.

Thank you, this explanation looks very reasonable.

All right, so right after the termination of the loop we have

  [B1]
  1: ForStmt (LoopExit)
  2: [B4.5].~A() (Implicit destructor)
  3: [B5.3].~A() (Implicit destructor)
  4: CFGScopeEnd(a)
  5: CFGScopeEnd(b)

... where `[B4.5]` is `A b = a;` and `[B5.3]` is `A a;`. Am i understanding 
correctly that while destroying `a` you can still use the storage of `b` 
safely? Or should `a` go out of scope before `b` gets destroyed? Also, is the 
order of scope ends actually correct here - shouldn't `b` go out of scope 
earlier? Given that they are in very different lifetime scopes (`a` is one for 
the whole loop, `b` is per-loop-iteration). I guess the order would matter for 
the analyzer.


Repository:
  rL LLVM

https://reviews.llvm.org/D16403



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

Reply via email to