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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] "modernize-use-emplace" does not provide diagnostic for `std::optional`
        </td>
    </tr>

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

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

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

<pre>
    
```
std::vector<std::pair<std::string, int>> v;
v.push_back(std::pair<std::string, int>("first", 1)); // OK - clang tidy provides warnings for that

std::optional<std::pair<std::string, int>> o;
o = std::pair<std::string, int>{"first", 1};          // BAD - silence
```

The full snippet here: https://godbolt.org/z/nW9dKscqo

</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUksFunDAQhp9muFiszBiW5cCBDeGSQy-VeqwMngW3Xpvahir79BV0m6bJJbVGsjzSzPib_5ch6NES1VCcoWgTucTJ-VqRvTmPnCe9U8818AaO_B68CVGBaEA0Kw3ReRAPL5lZ6n_eIXptR8AHpm0E8Qjika0gzsCb9TAvYfray-E74OnjHfAEiBftQwTELZ8BVluIMwPsADv26YmlbDDSjixq9cxm71atKLCf0lttx8AuzrM4ybiRvQJyc9TOSvO_SO43kmMgWvbxyvL8DqVsN46Xcwc6Ny1LWdCG7EBv1ADefJ6IXRZjWLB6nimyiTyBaNgU4xy24Xub0anemXhwfgTsboCd_VKppzD8cMCbRNVCVaKSCdVZmQvORVmJZKpPx0tVlcSVKHOhJBe8yPmJ8oqOBfZ5lugaORZc4DErcpGJQ0GU5bwocqHyvrxkkHO6Sm0OxqzXbXyiQ1iozoTI-CkxsicTdgsi7rKlm2zbToo28fVWlfbLGCDnRocY_vaJOprdvK_KipYB4tUp8lbfKF0CpXSdjRwIEJlyFJh18Y8rmNJytC5EPey2gCN_74cjTxZv6jf71HFa-sPgroDd9qX7lc7efaMhAnY7ZwDs7qhrjb8CAAD__3JDCKo">