Now that I'm paging this back in...I'm not convinced. People who use unassigned 
new usually know what they're doing. The false positives come when someone uses 
`new` while storing the result, but they //also// escape the variable into 
storage somewhere.

For the unused result case, I wonder if a -Wunused-like warning would cover 
this: warn on un-consumed `new`, silence it by casting to void, and assume any 
un-consumed new has already escaped (unless we inlined the constructor or can 
see it is trivial). 

I'd be tempted to ignore the used case except that that's blocking adoption in 
LLVM. We'd have to get sign-on from llvmdev if we wanted to change the `new 
Value(module, ...)` idiom they have going on there (e.g. to something like 
`Value::create(module, ...)`.)

http://reviews.llvm.org/D4025



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to