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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy modernize-concat-nested-namespaces false positive when using an attribute with a string that contains a double colon.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          kees-jan
      </td>
    </tr>
</table>

<pre>
    Thanks for clang-tidy. It's saving me a truckload of work! Also, I apologize for the long, and probably not very clear title.

In my `/tmp` directory, I have a file `nested-namespaces.cc` containing:
```C++
namespace [[deprecated("::")]] name {
}
```
There's also a `compile_commands.json` reading:
```json
[{
  "directory": "/tmp",
  "command": "clang++ -c --std=c++17 /tmp/nested-namespaces.cc",
  "file": "/tmp/nested-namespaces.cc"
}]
```
I'm running the command `clang-tidy -p=/tmp --checks='-*,modernize-concat-nested-namespaces' nested-namespaces.cc`

Expected result: No warnings
Actual result:
```
1 warning generated.
/tmp/nested-namespaces.cc:3:1: warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces]
namespace [[deprecated("::")]] name {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
namespace name
```
When asking clang-tidy to fix the issue, the deprecated attribute is removed. The result compiles, but is obviously not what I'd expect

This is with clang-tidy 16.0.0 taken from `apt.llvm.org/focal` (on ubuntu 20.04, obviously), though older versions were affected as well

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VU2P4jgQ_TXhUkqUDyDDIYeeZpD6MqeW9riqOA5J49iR7cCwv36rHL7Uw-yutNJIBhynqvz83nNRm-ZcvXeoDw5aY0Eo1PvY9805gTcf5aUDh8de72GQgODtJA7KYAOmhZOxhyjP4EU5E-Wv8AY4GmX2_V8y1PKdBGX0nt-hbmC0psZanUEbD0dpz7SbRIrrvZJJlG6j9GX-ftMwnCFap1G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