majnemer added a subscriber: majnemer.

================
Comment at: lib/Analysis/CFG.cpp:1949
@@ +1948,3 @@
+  }
+  if(!C->body_empty() && !dyn_cast<ReturnStmt>(*C->body_rbegin())) {
+    // If the body ends with a ReturnStmt, the dtors will be added in 
VisitReturnStmt
----------------
mgehre wrote:
> klimek wrote:
> > If the body is non-empty, but the return is not the last statement, won't 
> > that still call addAutomaticObjDtors twice?
> Yes, if there are statements after a "return" (i.e. dead code), it will still 
> call addAutomaticObjDtors  twice, just like before this patch.
> I guess that this case is not to common, and would be flagged by other checks.
Please don't use `dyn_cast` if you just need to perform a type test, use `isa` 
instead.
You need a space between `if` and `(`.


http://reviews.llvm.org/D13973



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

Reply via email to