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

    <tr>
        <th>Summary</th>
        <td>
            [clang-format]: formatting delimiters of raw string 
        </td>
    </tr>

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

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

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

<pre>
    I have posted the following question [on stackexchange](https://stackoverflow.com/questions/74102290/clang-format-and-special-delimiters), where is was suggested that it might actually be a bug, so if this is the case, I thought I would report it here. 

I am using a special raw string delimiter in my code to format doc string, it looks something like
```
R"mydelimiter(
    some raw string
)mydelimiter"
```

Now, clang-format likes to produce the following 
```
R "mydelimiter(
    some raw string
) mydelimiter "
```
which actually introduces a compilation error. 
I know that I can mark every block in my code with `// clang-format on/off` but I would like to find a more general solution. 

Here is what I tried so far:
- raw string format in my `.clang-format`
```
RawStringFormats:
  - Language: Cpp
    Delimiters: ['mydelimiter']
```
- as well as several versions of regex macro blocks 
```
MacroBlockBegin: 'R\"mydelimiter\('
MacroBlockEnd: '\)mydelimiter\",'
```
without any success. I am running clang-format version 14.0.6 and also I am running out of ideas :-/ help!

Apart from my tries above, this is my `.clang-format`
```
---
Language: Cpp
BasedOnStyle: GNU
NamespaceIndentation: All
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
PenaltyReturnTypeOnItsOwnLine: 0
SortIncludes: false
---
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJydVduSozgM_RryoiJFSEjIAw9J98xuqma7p7pnP8CAAG-Mzdqmmfz9yoZ0LpV52ElRxNg68rF0JOeqPGUHaNgHQqeMxRJsg1ApIdTAZQ3_9mgsVxKCZE9vY1lxxJ9Fw2SNQfIcxGljbWeC5S6Iv9LjDdQH6ooczAvV0tzZh6HxZrWI4ngb0bAQ5C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