Szelethus added a comment.

Hmm, we could make a redundant assignments checker: if a variable has multiple 
reaching definitions, but those all assign the same value, emit a warning. We 
could even use fixits with that.
  void t(int a) {
    if (coin())
      a = 2; // note: reaching def
    else
      a = 2; // note: reaching def
    use(a); // warn: a is always 2 here
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64991/new/

https://reviews.llvm.org/D64991



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

Reply via email to