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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Regression in indentation of a class within namespace and definition of a member function
        </td>
    </tr>

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

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

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

<pre>
    Hello,

The following code snippet is incorrectly indented with the latest `llvmorg-15.0.2` git tag

```cpp
namespace A
{
    class Foo
    {
        void bar() const;
    };
}

void A::Foo::bar() const
{
    auto x = 5;
}
```
If I intend to reformat only the definition of the member function `bar` with the command
```
clang-format --style="Mozilla" --lines=8:12 test.cpp
```
the `auto x = 5;` will be indented with 8 spaces with `llvmorg-15.0.2` version. However with the version of 13.0.1 it is correctly indented with only 2 spaces.

With best regards,
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U01v2zAM_TX2hYhhy585-NAuKNrDLsOAnWWLdjTIkiHJzbpfP0pJmyzrDCHhh0U-vkcPRrz1z6iUSdiXJD8k-cP59_sRYTIUP0k9w2gEgtNyXdGDdCD1aKzF0as3sgVqjwJO0h_B0z3FPToPSZMr9boYO--KOsszRgGYpQfP59tWFD6fcV3PEc0XdCsfEd5faR_PBtAzKu4cPBlzDf2VD8-rkQIGbhPWJWxP-LXzSfl4e-Pw4Qf7Bk-8-5CU4YQu0biv9S8svnkDvyApD1B_Uvp9yLP7MsELMedRC6BrFidjF-7BaGI0cChwklp6aTSYKUYWXAa0MG16jGGqFUARpx_Ej2ZZuBafdiTW9Ly7tNntnH9TSFgTxr6a31IpThbFldToKN7RzAWDIGT2octdydCSnPvBIyKlYMC73eggiurO3qfr8YrW0XAZPJsTknOd7ZIJbBQlvV6AjKv4v0WMTLJLx-xW3x8hPYQNtThzKxytfop90TRN0XR5W6WiL8W-3PPUS6-wT-rHW_aS-gDfcLboIiCpL535u1r8sqIBB2Wv20za3AnL72VNN6v6o_erC3vHnujQJ3PchozEJSdQdvnbrdb8pNHJlc5tJBt7qruqqdJj31UM2305tHk7dW3eiHHAqcapKZngzR5TxQdULoxGums8QSxBNk2Xyp7ljBV5sc871tZVtse6EVNR8bITTdeOSZXjwqXKAo6MJExtHyEN2-woqaTz7pokMuSsMTIZ6tPGHI3t_bYal8bGfQT-Byh-ZHg">