[PATCH] D37014: [clang-tidy] Add a checker to remove useless intermediate variables before return statements with comparisons

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 22 14:03:10 PDT 2017


lebedev.ri added a comment.

Please add the following test: (and make sure that it does the right thing :))

  bool f_with_preproc_condition() {
    auto test = 42;
    assert(test == 42);
    return test;
  }

I.e. if `-DNDEBUG` is present, variable is not needed, but if `-DNDEBUG` is *NOT* present...


Repository:
  rL LLVM

https://reviews.llvm.org/D37014





More information about the cfe-commits mailing list