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

    <tr>
        <th>Summary</th>
        <td>
            [FR] Alter clang-tidy check "performance-enum-size" to not trigger if enum class is empty
        </td>
    </tr>

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

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

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

<pre>
    An `enum class` can be used as a convenient type safe wrapper for integral values. Doing so would leave the `enum class` without enum constants. For example.

```c++
#include <map>

enum class ServerID : int {};
enum class ClientID : int {};

class Session{};

class Control
{
  private:
    std::map<ClientID, Session> m_clientSessions {};
    std::map<ServerID, Session> m_serverSessions {};
  public:
    void CloseClient(ClientID clientID)
    {
 m_clientSessions.erase(clientID);
    }
    
    void CloseServer(ServerID serverID)
    {
      // Compiler error is good! Wouldn't happen with type alias
      // using ServerID = int;
 m_clientSessions.erase(serverID);
    }
};
```

However, `performance-enum-size` currently flags those enums.

> Enum 'ServerID' uses a larger base type ('int', size: 4 bytes) than necessary for its value set, consider using 'std::uint8_t' (1 byte) as the base type to reduce its size (clang-tidy performance-enum-size)

To allow the use of this idom, I would like if either `performance-enum-size` didn't check if the enum has no members, or if there were an option that could be set in clang's config.yaml `Diagnostics.ClangTidy.CheckOptions."performance-enum-size.IgnoreEmptyEnumClasses"`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VU1v4zYQ_TX0ZRBBpmzLOvjg2HGbU4F2gR4XlDSS2KVIgUPZdX99MZS_snE2MBiIIh_fe3wzUkS6tYgbsXwVy_1MjaFzfnNQpnK_oZ-Vrj5vthbEKkU79lAZRSRWKVTKQokwEtagCBRUzh7RarQBwnlAINUgnLwaBvTQOA_aBmy9MnBUZkRKYO-0bYEcnNxoajCojgihw8-HnXTo3BhgmnWWgrKBEjg4D_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