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

    <tr>
        <th>Summary</th>
        <td>
            `modernize-use-emplace` not reported on usage via accessor
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
#include <stack>
#include <string>
#include <vector>

class VariableMap {
private:
    std::stack<std::vector<std::pair<std::string, int>>> mScopeInfo;
public:
    void addVariable(const std::string& varname);
};

void VariableMap::addVariable(const std::string& varname)
{
    mScopeInfo.top().push_back(std::pair<std::string, int>(varname, 0));
}
```
https://godbolt.org/z/KGdYxsoY4

If you remove the `std::stack` wrapper and access it directly it is being detected.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU8lu2zAQ_RrqQkSgKGs76JA4TREUPRUokFPBZWyzpUSCpJQmX9-RbMdJ2gKtQFEzHOK9N4uk0089qdlxKe8JuyXsmvDSjMpOGigptzEJ9YOUH_4cC2bc_yU4g0ouXILrrqyIkX4VwQhp4bPwlDQ3x5APZhYJSHm6SvGJSS9-eX1SsX05OKNfTrwwb_yTOL6lZkyLjHXR4YtyHu7HnSPlmXmS1qg3xLMzmgqtz0oJb5UbY6K_wdd0FmEUA17pXhBJc3ux130FfJX3EeT_GU7wNxepl4Ty5DzC4LXcT_HwTS414-2_V4i3L0xbyha6dzkdjfPEHN1DSj4ugPwO195p6WzKXUDgu2d8P33UDz-je9i8Lsf9jj65iQYY3Aw0HXBiavau2zWjj0F4D4GKEbuhFODsmES1Cdh9-7TYJlIJmAXVkPAQdJ5BX9RV2_KONUWm-1J3ZSeyZJKFZdoHpyGM5hmupghXMHgrFCxko0soyLuAKNSNdIpiD3Q24kTtQjYF27_L16TDJHPlBnSsnc-fKx_cdxSErolxgohGVTe8yA59u6lKVjb1ppByw3hX6UawWhSSM9S8qzMrJNjYk-qGcD7CI10h0CbVbWZ6zjhnDa9ZVxWsy3eqYLLRnVQ13-zqlmwYDMLYfNGxNCIL_SpJTvuIQWtiipcg_pBmPwKsdIgvpnRwod9hkR_FDNnK3a_afwFRhEWU">