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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] Incorrect wrapping when the word "interface" is part of the type. (C++)
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          sebastian-freitag
      </td>
    </tr>
</table>

<pre>
    `auto a = project::interface::i_list{0};` gets formatted to 
```
auto a = project::interface::i_list {
 0
};
```
This is incorrect. 
Consider the following **correct** example code, formatted with 
`clang-format -style=LLVM ./test.cpp` 
(**using llvmorg-12.0.1**)

```
#include <vector>

namespace project {
namespace interface {
using i_list = std::vector<int>;
} // namespace interface
namespace api {
using a_list = std::vector<int>;
} // namespace api
} // namespace project

using interface = std::vector<int>;

auto a = project::interface::i_list{0};
auto b = project::api::a_list{0};
auto c = std::vector<int>{0};
```

Now consider the output when using **llvmorg-15.0.7 or llvmorg-16.0.6**:
```
#include <vector>

namespace project {
namespace interface {
using i_list = std::vector<int>;
} // namespace interface
namespace api {
using a_list = std::vector<int>;
} // namespace api
} // namespace project

using interface = std::vector<int>;

auto a = project::interface::i_list {
  0
};
auto b = project::api::a_list{0};
auto c = std::vector<int>{0};
```
**Notes:**

- The expectation would be that all the three auto a, auto b and auto c get one line each and no wrapping is applied to the line starting with auto a.
- The word "interface" seems to throw the formatter off, since the other lines are just fine.
- Consider the debug output (when running with --debug-only=format-token-annotator) below
```
(...)
AnnotatedTokens(L=0):
 M=0 C=0 T=Unknown S=1 F=0 B=0 BK=0 P=0 Name=auto L=4 PPK=2 FakeLParens=2/ FakeRParens=0 II=0x5653b23584a8 Text='auto'
 M=0 C=1 T=StartOfName S=1 F=0 B=0 BK=0 P=220 Name=identifier L=6 PPK=2 FakeLParens= FakeRParens=0 II=0x5653b23139f8 Text='a'
 M=0 C=0 T=BinaryOperator S=1 F=0 B=0 BK=0 P=22 Name=equal L=8 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='='
 M=0 C=1 T=Unknown S=1 F=0 B=0 BK=0 P=22 Name=identifier L=16 PPK=2 FakeLParens= FakeRParens=0 II=0x5653b2313908 Text='project'
 M=0 C=0 T=Unknown S=0 F=0 B=0 BK=0 P=23 Name=coloncolon L=18 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='::'
 M=0 C=1 T=Unknown S=0 F=0 B=0 BK=0 P=520 Name=identifier L=27 PPK=2 FakeLParens= FakeRParens=0 II=0x5653b2321e38 Text='interface'
 M=0 C=0 T=Unknown S=0 F=0 B=0 BK=0 P=23 Name=coloncolon L=29 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='::'
 M=0 C=1 T=Unknown S=0 F=0 B=0 BK=0 P=520 Name=identifier L=35 PPK=2 FakeLParens= FakeRParens=0 II=0x5653b2313938 Text='i_list'
 M=0 C=0 T=RecordLBrace S=1 F=0 B=0 BK=1 P=23 Name=l_brace L=37 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='{'
----
AnnotatedTokens(L=1):
 M=0 C=0 T=Unknown S=1 F=0 B=0 BK=0 P=0 Name=numeric_constant L=1 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='0'
----
AnnotatedTokens(L=0):
 M=0 C=0 T=Unknown S=1 F=0 B=0 BK=0 P=0 Name=r_brace L=1 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text='}'
 M=0 C=0 T=Unknown S=0 F=0 B=0 BK=0 P=23 Name=semi L=2 PPK=2 FakeLParens= FakeRParens=0 II=0x0 Text=';'
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v2zgT_jX0ZSCBJi1_HHyIo9dA8aZt0Gb3WlDS2GIrk1qSqpN_vyAp20oap0mTxe4CCwiUpeFwnnk4wxlLWCu3CnFJshXJ8pHoXK3N0mIhrJNCJRuD0ontq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