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

    <tr>
        <th>Summary</th>
        <td>
            Missing bugprone-exception-escape warning when inserting `std::endl`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          N-Dekker
      </td>
    </tr>
</table>

<pre>
    Clang-Tidy does _not_ appear to produce a `bugprone-exception-escape`  warning on the following code, which inserts `std::endl` into an output stream:

    #include <iostream>

    int main() // No warning here!
    {
      std::cout << "Hello, World!" << std::endl;
    }

It _does_ produce the warning when only just a literal string is inserted: 

    #include <iostream>

    int main() // warning: an exception may be thrown in function 'main'... [bugprone-exception-escape]
    {
      std::cout << "Hello, World!\n";
    }

Output:
```
MySource.cpp(3): warning: an exception may be thrown in function 'main' which should not throw exceptions [bugprone-exception-escape]
int main() // warning: an exception may be thrown in function 'main'... [bugprone-exception-escape]
    ^
```


It seems to me that Clang-Tidy should produce such a warning in both cases. Right?

Observed using LLVM14.0.3 on Windows 10 (C:\Users\Me\AppData\Roaming\ClangPowerTools\LLVM\LLVM14.0.3\bin\clang-tidy.exe), using the ClangPowerTools Version 8.7.0.570 extension on Visual Studio 2019 Version 16.11.16
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzFVE1v2zAM_TXOhYgh27GdHHxYnQ0bsG5D27XHQraYWJsiGZbUNP9-lPPVFuswYAUWCJEpSo-Pj5QaI3ZVrbheT2-k2IEwaOFeG3cPvO-RD-AM9IMRvkXgEBWs8WuyNU7xscXeSaOnaFveI_kAtnzQUq_BaHAdwsooZbZhoTUCo7SGbSfbDqS2ODgb8KwTUfaOBmqhAobUFJJrMN713oF1A_JN2MKWETv8A_2iNJO6VV4gRFktzXHj-5cbCRA2XOoonUfpgs59oAFfzIlshwNxS55AlxdnA-BEsSVOIRgNgkk_ImUXkrozgxIBIU2P7udpZRdPwZdPGX5ycB9Uvz_JHIQ7Utt2SEpotYMf3jqqgJIOB66CLMEv7UFLDOHgjTU6sAjIVJBTwWnnDppAdDBbTWdh5XU7eqK03MOUcRxDlF-83i758g0Ez2uKlf5J369jG537p2CHMZqXu2vjhxbjtu8p94ySD9n-S-KHFred8UoAXaX99jOK_Ttd_ndJ8ve_VexF71rEjQ2PxCYE5w6ePCYHCY59bT3Jwk-tTRwb4zpouUUbw5Vcd1SmD89q11BrP6AAb8OJz59vL5NZzOIsvC93UguztZAwSnFehwrn9Xc6YGm-pGTqd32_5I7T15Xhm6BaXo_0vpktDjfGqLA1oB6mPTgZDemV1-2YiqNUYnzE0BrUensq4Y6-gIJbCh0En8clweQlo_I41OMajVtpPV3ca-eFNJCyZHE6kRRxksRJMRFVJhbZgk-cdAqrS2nHaK9W7Pk7sX8Jgvmbd3XiB1V1zvU2LI_NtJau803cmg0ZSj0cpykF-4GtI5MIeLT0kRezJJl0VbKalUXCRJ4X-WouxDyZrZrZbF6uylXCGJso3qCyFfUZXUyNWxghwiXNlxNZpSxNWcmKlOX0FWezvKGlRTpPebFq22jGkLpVxYFHbIb1ZKhGSiSBJaeS1tmzk5M-a404hiN87l1nhurLdIk_f-IwGWNXI_df5hUj-w">