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

    <tr>
        <th>Summary</th>
        <td>
            [ASTMatchers] Assertion with hasName matcher and inline namespaces
        </td>
    </tr>

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

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

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

<pre>
    If an inline namespace has the same name as its direct parent, This can lead to assertions (or missed matches in release builds.
Take this example below with the matcher `cxxRecordDecl(hasName("::a::A"))`
```cpp
namespace a {
inline namespace a {
class A;
}
}  // namespace a
```
The matcher should match as the inline namespace can safely be ignored, but currently it sees that it consume the inline namespace, Then when it tries to consume the enclosing namespace `a` it fails and reports no match.

https://godbolt.org/z/a3dzM8YnW
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU01v4zgM_TXyhWjgyElsH3xINzCwh-5ht8BijrREx-rIkiHKTdtfP1Dstpl2AEEfJPjx3hOR2ZwdUSP290JK94QjcV0IKcX-lOEcBx-ad2vWef3a_N0DOjDOGkfgkmdCRTAgQxwIGMfFDMhgIoM2gVSECQO5KORf8DgYBoUOLKGG6AGZKUTjHYOQlQ8wGmbSMGJUAzEYB4EsIRN0s7GaNyI_ifz4iD8JYspGLzhOlqAj6y9wMXG49rIkCCAOuXp5-ZeUD_pEygpZDcj_4EhCVglrcRTFEZfjmAyyTuuQL4XS5brUNC2WT9wIorxfjN84ufEpi8xwFMX6FuXp4wIgZCtkexv5pfAK-AYTD362K0ewcv-tgcQyY0_2FToCc3Y-kE4adHMENYckiX0FE4GJUg6M6aG843mkP-ZcFCQHl7SZCDGYFOp_iyKnrGfjzjfNiEOO4pCnmB6NZUCnIdDkQ2RwfoGySrvsQ4wTJ1Wu9Jy97ryNGx_OQrZvQrZY6LeH6of7P9NNoeuixoyabSmlLIpDWWdDs9tWOy3roqpLJbeHvtcF1VR0crsvqSqrzDQyl7u8lHV-2O6KerMt635fK-yrslc17sUupxGN3Vj7PKbamWGeqdnmeV0WmcWOLL-PD13g6l3nJzQp6K6bzyx2uTUc-TNNNNFe5-743-PDIiqL_QmO79Ow_OP1o37onkj7qglnc7DNF7ZMHOZuo_woZJuKrsfdFPwTqShke22VhWxXLM-N_BUAAP__QfFPAw">