mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 07:48:30 +00:00
Fix formatting of compound-type variable declarations in macros (#6997)
By default clang-format interprets function-like macro invocations as function calls. E.g. the argument of `CARBON_KIND(llvm::ListSeparator* sep)` is interpreted as an expression, meaning the `*` is an infix binary operator, so it inserts a space before the `*`. This change teaches clang-format that `CARBON_KIND(x)` and `CARBON_ASSIGN_OR_RETURN(x)` rewrite to `x`, which is close enough to the truth to enable it to format them correctly. See the [clang-format docs](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#macros) for details.
This commit is contained in:
1 parent
2e0d9dc709
commit
aec2534e9d
3 files changed
+8
-3
No files matched your search
@@ -176,7 +176,7 @@ class StepStack {
|
||||
PushSpecificNamedConstraint(specific_named_constraint);
|
||||
break;
|
||||
}
|
||||
case CARBON_KIND(llvm::ListSeparator * sep): {
|
||||
case CARBON_KIND(llvm::ListSeparator* sep): {
|
||||
PushString(*sep);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user