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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] modernize-macro-to-enum should ignore macros used as arguments to other macros
        </td>
    </tr>

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

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

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

<pre>
    Consider:
```
#define INSIDE7 7
#define INSIDE8 8

#define CONCAT(n_, s_) n_##s_
#define FN_NAME(n_, s_) CONCAT(n_, s_)

extern void FN_NAME(g, INSIDE7)();

void gg()
{
    g7();
}
```

If the macro `INSIDE7` is converted to an enum, this code fails to build properly.

Macros that are used as arguments to other macros, or that appear in the expansion of other function like macros, should be excluded from conversion to enums.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFUk2PmzAQ_TVwsRJ5DQRy4JBNNlKkbnpo7yuDB3Dr2JE_ok1_fceEqCgbqcjy15s3b97gxohrvTXaSQE2yTYJ3SV0k6zoNG5HlgnopAZyOP447N5KUj4HKlJNwAO8_X7cbn4mrNIfCdsSh_OaxH2GA08P4fvjx3Hz_vYQ_yzJXA4-PVhNLkaKWYY-xk51RwKr4py9zpkjpe8n7AaUUwTBry8faeXueafG-dARPwA58dYagthdfUWJdKQ1-gLWgyDeEK4J6HCKNfphBAWQjkvlItoEqQQ5W3MGq67LucZ7TI5BA_eEWyDBYULucN-HE2g_8g2WYW91uChh7EQ4n4FbIvVYJ3yeOT4Ao4npJkoXdOvjjZK_YZbADSZgRU0ktSoI1OysOU2exhwoGx25ZSrqTKyzNU-99ArqpHhtFdf9wktxTYodOaFXq-UfWIwCC28WkXkXkb029i7-f39psKoevD-7-IzZHkcv_RCaZWuwv3ulLvdlgR39Ba3Ho3QuAFrbF_k6r9KhbrMyE2VRiJdOlKIDmnersuKUNVmzKl5WqeINKBfdJIw1AR8Ni53BZeYO74pdKmtGGaP5S0lpnjG6bLs2Z2W3goJWOV-XSU7hhD97GataGtunth4LxLwOQSWdd_9A7hw2BWAS_wY9V9i-jQjKD8aISZYHPNn6C5yOZuvR6V9z0TiN">