NoQ added inline comments.

================
Comment at: test/Analysis/cfg-rich-constructors.cpp:481-486
+// CXX11:        [B1]
+// CXX11-NEXT:     1: [B4.4].~D() (Implicit destructor)
+// CXX11:        [B2]
+// CXX11-NEXT:     1: ~temporary_object_expr_with_dtors::D() (Temporary object 
destructor)
+// CXX11:        [B3]
+// CXX11-NEXT:     1: ~temporary_object_expr_with_dtors::D() (Temporary object 
destructor)
----------------
I decided to include/document/test this part of CFG as well (even though 
previously it was omitted from the test) because while working on this patch i 
realized that it's completely correct. Previously i was ranting (@xazax.hun 
remembers me ranting) that i don't understand why do we need a second diamond 
in the CFG with two destructors on each path. But it's quite obvious: we 
destroy the original temporary at the end of the 
full-ex...-uhm-i-mean-statement, and then we need to destroy the 
lifetime-extended elidable copy of the respective temporary. So for the 
purposes of the CFG there are indeed two diamonds with correlated conditions - 
which will turn into two separate paths in the ExplodedGraph. It's nice to know 
that in C++17 we don't have that diamond at all - only the first diamond.


Repository:
  rC Clang

https://reviews.llvm.org/D44597



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

Reply via email to