https://bugs.llvm.org/show_bug.cgi?id=40225
Bug ID: 40225
Summary: Formatted content inside raw string literals is
indented too far
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: Formatter
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected],
[email protected]
Given this source:
```
int* func1() {
auto S = R"cpp(
int* generatedFunc1()
{
}
int *generatedFunc2()
{
}
)cpp";
}
int *func2() {}
```
and this clang-format:
```
BasedOnStyle: LLVM
IndentWidth: 4
Language: Cpp
RawStringFormats:
- Language: Cpp
Delimiters:
- 'cpp'
BasedOnStyle: llvm
```
I get this output from clang-format:
```
int *func1() {
auto S = R"cpp(
int *generatedFunc1() {}
int *generatedFunc2() {}
)cpp";
}
int *func2() {}
```
The content of the raw string literal is indented way too far. What I actually
want is:
```
int *func1() {
auto S = R"cpp(
int *generatedFunc1() {}
int *generatedFunc2() {}
)cpp";
}
int *func2() {}
```
Can that base indentation be removed somehow? An option might be to use the
indentation of the first non-empty line as the base indentation.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs