<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/109927>109927</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang-tidy bugprone-exception-escape only reports directly visible throws
        </td>
    </tr>

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

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

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

<pre>
    The clang-tidy check bugprone-exception-escape only considers direct visible throws

For example:
````
void f(bool b) noexcept(false) {
 if (b) throw 1;
}
struct C {
    ~C() { f(true); }
};
````
However, the moment that the implementation of `f` is not available, the check no longer reports a potential problem:
````
void f(bool b) noexcept(false);
struct C {
    ~C() { f(true); }
};
````
(https://compiler-explorer.com/z/aWWbsx7vM)

This function declaration explicitly mentions `noexcept(false)` (aka: this is expected to throw an exception), so it would be safe to also report this as a violation. Without any exception specification, we don't know if the function throws without its body, which might also be a risk. Although as this has been the default for long, this is a situation that shouldn't be reported by default. (Though it could if we introduce a strict-mode)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VE9v-zYM_TTKhUigyHHiHHxoUwTDgN2K9SzJdMxVlgyJTpod9tkH2W7T_QF2GH5AEMs0-cj3RFKnRBePWIvyWZQvKz1yF2L9869PA_qVCc29fu0QrNP-smZq7mA7tO9gxssQg8c1flgcmIJfY7J6QAje3cEGn6jBmKChiJbhSomMQ-AuhlsS8kXIp_n_HCLgh-4Hh6JYbGIvH7_Jcg3UQCtUZUJwYIQ6gg9zbqGqVruE2SYOz7M_UAvZOxunnLAVxfJNHF7mQ-I4WobTtzAA-OMkVLWATSk5jhlcFM_wFZoPX3j_qPancMMrRqFOwB1CH3r0DNxpnt4pk80mnYWD0ILYy1bsJVACHxj0VZPTxuEnwiy6D-CCv2CEiEOInEDDEBg9k3YwxGAc9v9bxC9eP0weoaqOeUi5VHUW6mxDP5DDuMaPwYWIcWNDL9T5d6HO-u3NpI_D9Zec41vfvHaUoB29nTRs0DodZz0zCFlid4csMgWfssD_RnUvc5fody2KJ-CMSCnHo2VsgMPSOzqDLn2ew9QJUgBiuIXRNWAQkm4x-2uXwnI7M57Ol3Sl4KbaNvBG3IWRQfv7AxPSgJZasnrOcIIbQpNPB4Z3H265nXMffPGd5whuCxpxgjysU2hHtoOeLh3P5RgEDZHS-waeXPa_dLmsqbxOJzCIfkJvsNWjY2hDnBpt7r5ZFA2JeNRLcs2Qusx9LtHgwhkbMPdPnE3W9nXORwx20orazI08x9CMNleWOJLldR-afCWrpi6aY3HUK6y3B3VQpToWctXVZleWVamrZie3dl8cttvCFmZfokZZlcdqRbWSaiePqpSVqkq52Vu5RVkaW-4kbvcodhJ7TW7j3LXfhHhZUUoj1lt5PKrDymmDLk2LUKnHwhNK5cUY6xy1NuMliZ10lDg9cJjYYX16LMn_WI-f4zsvR3f_23pcjdHVf52QC3E3mmUsct7lsR5i-A0tC3WeyCShzgufa63-DAAA__9C_t9V">