Hm, interesting. In this case:
+void test_expr_negative_func() {
+ unsigned a = 0;
+ unsigned b = 1;
+ a = a > 5 ? a+func() : a+func(); // no warning
+}
I think we should actually be warning, since only one side of the branch will
ever be executing. Maybe we can include a flag here that says whether the
expression walker should step into calls? What do you think?
Other than that, this looks good, except that I would add the true-expr and
false-expr as ranges to highlight in addition to putting the warning itself on
the colon.
Jordan
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits