<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=http://email.email.llvm.org/c/eJylVk1z4jgQ_TXmosLlDxzMgUMCpDZVe9qias6y1WBNZMkryRDm1--TgQATJruZTTm2Prvf634tURlxmK8b6VjDHauINKus6beNZ33HqgOLiqeGKykoKpZRVjbedy7KH6PsGc9W-qav4tq06JyWZc9_nBoztjHqNcoWTHpW85aCSanZV2w8d71S-DwURRFHyTJKHhdGO8xZWPjZlBGVUT42doveD_zrcsVXbjdxx63RQ3J86ih7Cs9xNMtZyqIsk7pW_eC1IQ4PcdN1GMZkfl4Z3LC7644LhrentlPcE4vyhT90pAP3dZSvjtPO2772bM3tljyLpicY7DSCKK-ZCOELU9PlyTIa-dOvvNy3jQmp8V5dO0FC8QjqLNXYDUclOMZxjDechjQXyw-IYOermH7N_EULCe_gjhR2faVkfUG8_gnvefFVWLDrZjmmPseGBE-TzzKcXZM4oVy9cZChu1jeA_uG2fTa182ijTJ8WHYIy-LkBtR1-6zLY3eoR2HIMW08oxblw_WBCcm37jdU_9R7JjfsYHrWO_B5SMYvwRcKM4wNcfx3o9XOTcpST3d3IYOsM72tKaQjf0yn4TULdvfcaqm3oRll07OgpixQvIgQs5BgEOf422V4LKhW3HIvUfNXsvxNTbAPf1GxuosfpQD8ZbCKFFD44uCS2nmuvRzwMLNhLbUVWbbpdT0MgdcHiYSQ5o8XxFNm6e-eHOixhix9SVv_EX6a4lVco78J_ftRT28dak96dWAtt69AdIn9DbgvHRpXuNJz-qEyTTZsfT_F204qBM-S760-SiC5r61LUXTceln30AQuFGjZEbWOwS7AMtdXpvOy5Sq-3vitgR-2J1abXgnWWVPxCoydUTtiPpgl7iRG9riKhvL4xtWeH9w4lN74zBoJHp_YOCxiBh5NSzAAdWeLozOJ-LZsbzQOl0AbdTd4wMNZ1W-DjACWbaR1nuGsRMpQh7AVAHINkMd7csAS7AdaDvcE5BYoO2zn_kInHAraOCT5-ZY0FgnDOjLhDAsgX9-XLBYsmiSP3Br9xJVq4Rb9H4etUUaK0Bb7SnH5Kil0uKI3SzAQCKEP6e5Ij7-bRjujR2Kei1k-4yPe-8bY-Z9UkaDdXy-j3qr5J5e9UrvzZ4ysfB_K41k6h-pAo8izZDpq5ikvSZSJEEnBRVqXMF-XD2X6UOXlrKZypHhFys2DRrMM58Vw2GxAzpMWQaDFcvT_gch5lmRZkqaTtCzKdBLPkk1eiGlGE55MKMkRGWq5VHGwEw7OkZ0PJpF2h0klnXeXSe6c3GqiATcQepTh0DkyKJbhvlpbjh87Xu4o3FJXSjzmHRZxdZ4viVC0-4YGDYVUIQTtIGfpDshZi-ZoIDUfGP0DIZT-nQ>53207</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang] "Transitive" deprecation diagnistic not emitted when coming from `-isystem`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:frontend
      </td>
    </tr>

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

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

<pre>
    This has been brought up by [halide](https://github.com/halide/Halide) folk, it came up in https://github.com/halide/Halide/pull/6555.
Consider: https://godbolt.org/z/n8EaEsv4s
```c++
# 1 "include/header.hpp" 1 3
// include/header.hpp

template <typename T>
struct Target {
  Target(T d) {}
};

template <>
struct Target<int> {
  [[deprecated("...")]]
  Target(int d) {}
};

template <typename T>
struct Indirect : public Target<T> {
  Indirect(T d) : Target<T>(d) {}
};
# 70 "include/header.hpp" 2

struct Example {
  Indirect<int> x{1};
  Indirect<float> y{1.0};
};
```
This does not emit any diags: https://godbolt.org/z/n8EaEsv4s
But if you use `-I`, you get: https://godbolt.org/z/bvs488n7v
```
<source>:17:19: warning: 'Target' is deprecated: ... [-Wdeprecated-declarations]
  Indirect(T d) : Target<T>(d) {}
                  ^
<source>:22:18: note: in instantiation of member function 'Indirect<int>::Indirect' requested here
  Indirect<int> x{1};
                 ^
<source>:11:5: note: 'Target' has been explicitly marked deprecated here
  [[deprecated("...")]]
    ^
1 warning generated.
Compiler returned: 0
```

This particular case seems rather suboptimal.

While we could probably solve this easily with `-Walways-emit-deprecation-warnings` or something,
i'm wondering if this is a bug in the first place, or we can come up with some subset of cases that we could diagnose?

What do people think?
CC @AaronBallman @zygoloid @dwblaikie @alexreinking @steven-johnson
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVsty4joQ_RqzUeHyA8dmwYIAqUnVrG5RlbVsN1gTWfKVZAjz9ffIQIAJk7mZlGPr5e5zuk-3KXV9mK0bYVnDLSuJFCuN7reNY33HygMLsseGS1FTkC2DpGic62yQzoPkCddWuKYvw0q3mJyOJU_fToMp22j5GiQLJhyreEvepFDsKzaeul5KPB6yLAuDaBlE84VWFnsGFn41petSSxdqs8XsJ_5VseIru5vY46vBQ3S8qiB59NdxNUlZzIIkEaqS_eC1IQ4PYdN1WMZmej7p3bC7544HhrujtpPcEQvShTt0pDz3dZCujtvWmb5ybM3NlhwL8hMMdlpBlNes9uHzW_nyZBmD9PF3Xu7bxoZQuK-unSChuGrqDFV4G44KcAzDEHc49WnOlh8Qwc5XMf2e-bOqBbyDO1LY9aUU1QXx-he858NXYcFbN8ex9Tk2JDiPPstwck3ihHL1xkGG7mJ5D-wbduNrXzeHNlLz4djBHwujG1DX47Muj9OhHmtNlintGLUoH64OrBZ8a_9C9Y-9Y2LDDrpnvQWfh2j87H2hMP3aEMc_Gy13dlIUKt_dhQyyVvemIp-OdB7n_jb1dvfcKKG2fhgk-VlQOfMULyLELiToxTl-uSyPa6okN9wJ1PyVLP9SE-zDX5Ct7uJHKQB_4a0iBeSfaFxCWceVEwMepjespbYkwza9qoYl8PogER_SdH5BnDND__ZkQY81ZOhL2vqf8OMYt-wa_U3o31s9vXWoPeHkgbXcvALRJfY34L7UNK5wxef0Q2WKjH_1vYu3nZAIniHXG3WUQHRfW5ei6LhxouqhCXxQoGVL1FoGuwDLbF_qzomWy_D6xZcGftieWKV7WbP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