<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVE1vozAQ_TVwGSUCO-TjwKFNWrWq2tNKPRvbgBvHRrZJmv76HUPSsKvtaSNibGZ48_zemMqKc_mkErJNsl2S3Y3jc0JWB2hkCMo0EFoJyTI7KM9nToreCGbCTH52TnqvrMEYnJgzMbeVTib0bgqG4fHiXXd5QqgyXPcCcemWM--lCwl9mL4V5KHTLAwZygR4RYoQJ2_fiUerBNTWJmQdAyYhmwvC6n6cAP4u6GRtIhS8QbLa4gXj8jW-RO-v7-2mFCLogSnEXf8bOtam2zzLIjeKN2RG1iSub6C3RDom5j8k3qpfBZuS-RWVBeXB2NBGpU_OxlGFdjCIWyEjurE47c6zjnkUDz0LbC_n8GRP8igdcM1MMwtKnAEjQXGm9RmEDNIdlJEesVgAayKgESqgvbHot-3AjBjM9sAq2wdQYQ7vVxLyk6FrMoaOA5tJuZPSGjw7jxUq3AVUjhneYlGvBI62vrbaaFHsK4ab_i6ekHwUow2h87HNyCNejRWV1WFuXYOrL_x_SCq-Hl5ePqYKXiVgXafP1772fdNIVAobSX0ih4ElNqd1TvKA0vAWdyCH3Lo3PArCtArnyBYJRmeX2Xxa5932WqAu2Dt7LCCNRykeO4tnpUJtgh0DmKDx_ABrmuEcoWD0EZ4hursf6vUeXWAeWaE63KkKWSozhITlfoRhoG2IZC6FtuAtqFFJ1Jbv0cjIp5Kg1UHFnSKDwQNkcLrGkAMLf2wjFSUVG7phKetDa13JmdPWN0wf5VeX9k6Xf9mAXdBXc24PuND6eL3NOmc_UExcKu976XFS0MVimbZltcjrxXLDxGZVb6hcLxcFXdasrhe0WG_EKtWsktqXSXGfEFL1aDCJe8TbrbXis2KX_j8fVZKMkCwnq5zmRbGZUyJWdb7MOa3zWvAqWWQSvwh6HnFiv6WuHCCRmcegxuPmb0H89KjGSDnQR4ZBBT0sJtyLHfz4YUWn7KU_xvZIB8LlwPY3aBPLlA>53446</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] misc-redundant-expression too aggresive?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            bug,
            clang-tidy
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          carlosgalvezp
      </td>
    </tr>
</table>

<pre>
    Hi,

I'm getting the `misc-redundant-expression` warning here:

```cpp
#include <cassert>

template <int M, int N>
void foo(int n)
{
    assert(n < N || n < M);
}

int main()
{
    foo<100, 300>(200);
    foo<300, 100>(200);
}
```

There is nothing wrong with the code, no copy-paste mistake. However clang-tidy statically determines that one condition is redundant and warns about it. With the example above, clang-tidy will say that both branches sides of the `||` are redundant!
https://godbolt.org/z/je3dzEKKj

However applying the suggested fixes will incorrectly change the functionality of `foo`.

Would it make sense/possible to make it less aggressive? I think the use cases described in the docs make a lot of sense, so if the check could be limited to that it would be great.


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1VMFuozAQ_Rq4WInATgo5cGiTVq2q9rTSno09gBvHRrZJmn79jiE02dU2IoCZ4c2b98bUVp6rZ5XQbZLtkux-Or8ktDiQFkJQpiWhA5LcZQflxcKBHIzkJizgs3fgvbIGY-TEnYm5HThI2P0tGIanQ_T95Qllygg9SMRlW8G9BxcS9nj7VoBDr3kYM5QJ5A0pknjz_p14tEqSxtqEljFgErq5IBQP0w3B3wWdliZCkXeSFFs8yLR8iy-xh_m93S2FCHrgCnHL_0PH2mybZ1nkxvCCzGhJ4_oKek1kU2L-Q-K1-izYLZlfUVmiPDE2dFHpk7PxrEI3GiSshIhuLN7250XPPYqHngW-hyV5tic4giNCc9MugpJngpGgBNf6TCQEcAdlwCMWD8SaCGikCmhvLPptO-FGjmZ7wms7BKLCkvyeScAnR9cgho4jm5tyJ6U18fw8VaixC1I7bkSHRb2SeLbNPGqTRXGuODb9XTyh-SRGF0Lv45jRJzxaK2urw9K6Fldf-P8AJr8eX18_bhWcJeB9r8_zXPuhbQGVwkFSn8hhZInDaZ0DEVAa0WEHMOY2gxFREK5VOEe2SDA6e5ctb-v8toOWqAvOzh4LgPEoxVNvca_UqE2wUwATNO4fwtt23EcoGHsiLyS6ux_rDR5d4B5ZoTrCqRpZKjOGpBV-guFE2xDJXAptibdETUqitmKPRkY-NRCtDip2igxGD5DBaY4hBx7-aiOVFZMbtuFpUEFDlawfrm4m6x358XuABeylramrdHC6-sczHJmhXgp7wIXWx_my6J39QOVxqbwfwOPNmq1Wd2lXCVGUqw3kq3WZ582mKTkrshxqWhayrFeQal6D9pFpQmk94DTQKAhebpjjs_UuVRXNKM1yWuQsX683S0Zl0eR3uWBN3khRJ6sMcPPrZWQVRyt11UgQcT0GNe4sfw3iV0a1BkaZIj4fQmddJbjT1rdcH-GrT8eOqrGdPzdytgs">