<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJytVE1vozAQ_TVwsRKBHSAcODSb9rjaA3_AHwN4ZWyETaPk1-9AQtvtNj20KxljvzGP98ajEU6dqyhPbiM5RslDRJm20kwKSMR-tN5E9Gme2eMtvswB-sHwsJwJ5wEs74HUL4eenVakieg-oiWJisMVJWQhesDhThZG_FbbEFEEHglP8ZyFE5mh4oC74zzYgaAAHOSnIyc-Wm3bu2z1jUukqOtIZrZ65foSkVxF1R9KWmkQ8Z2bjCLWhRUlAaG2e5u1zxNA34jODizKvur-fxFJ-uL-RvNN9woMYM3gVbPDO0x8gMl_MRSCOjBX9yLibkS-RmYf18Xftd-FMPg5F4vB1inhTNi6scXdBR_2qxaXEfI6VhVTJSt5zCc0OlZlSfNiT2kST6Op3vHo0E1iK12PG2Oe19dmGN1vkHj_T9r7CTwuMsaKPO4qJSDNFcimgV0jOW_2rCilaoqmyNie7mPDBRhfXb3F3_-lrmiC8lO6S-guzbItE0Wal03BeZkLlstol0DPtdnOPHNO4rFaKMXUegwa7YN_DXLvdWsBVoVBBwOVNNy2m6DVGXuDHAbpRmgnjfekLfgNFiCWzqaH3o3nuXW0EDw5jQ7r6dSBJZOfS2tuKMURG4UOmht94UE7S4J7ReBuUceL72ox_QexWnQb>53376</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy(cppcoreguidelines-owning-memory) gets wrong when using {} initialization to initialize gsl::owner<T*>
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

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

<pre>
    ```
#include <gsl/gsl>

template <typename T>
void f() {
  gsl::owner<int*> a1{new int{1}}; // No warning
  gsl::owner<T*> b1 = new T{1}; // No warning
  gsl::owner<T*> c1{new T{1}}; // warning; should not warning though

  gsl::owner<int*> a2 = new T[3]; // No warning
  gsl::owner<T*> b2 = new T[3]; // No warning
  gsl::owner<T*> c2{new T[3]}; // warning; should not warning though

  delete a1;
  delete b1;
  delete c1;
  delete[] a2;
  delete[] b2;
  delete[] c2;
}
```
https://godbolt.org/z/3PTbzre6T
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytU8FymzAQ_Rpx0dgDkoFw4BDXybHTAz8giQ2oIyRGEvHYX98FmzhN4x7SziwgvRVPb59W0rWnmhTpNdIDSR8J49oqM7VACf_WBUPY8_zmT9f88o4wjEbEZU08jWDFALR5W_TqdEtfCHsgrKKk3F9QSheiRwx3tODxX20jYQg8UZHhOgtHOkPlHmeHOfieogAM-t3Ro_BW2-4uW3PlkhnqOtCZrVm5vkSkVlHNp5JWGkRC7ybTUuviitKIUNe_d-3vBrB3ovM9J_lXq_9fRIq9VX-l-cfqWzCAPYNHzfcfMPkJpv7EUAjqQK_uZeTdjLpl5joug997v49xDLMXS4Gda6Uzcet8h7MzPvxHI88eiiZpa95WvBJJ1NFArYyw3Sbq9oQ9r8ZROQ_dpHF_bSFs0Fi0ZDPA4PxpvhIdxECP3qFPxx4sncJs2XxRygNeAB21MPosonaWRndD4O5hJZM39Qf9OvaT3Co34MSY1_WzGb37CQr77lmHMEHAQc55WSR9vVMqL3YVbwuRszKrci6VKLkQ7YsEyYrECAkm1BdPE12zlLE0Y7uU7bI833JZZkX1UgpRFZIXiuxSGIQ223nj2cnE14sGOXUBk0aHGG5JEYLuLMDKLyZsI19XFSvKB9woWQTXi9pf8zddxw">