================
@@ -195,6 +195,51 @@ TEST_F(BracesInserterTest, InsertBraces) {
"#endif",
Style);
+ verifyFormat("if (a)\n"
+ " if (b)\n"
+ "#ifdef A\n"
+ " f();\n"
+ "#else\n"
+ " g();\n"
+ "#endif",
+ Style);
+
+ verifyFormat("while (a)\n"
+ " if (b)\n"
+ " f(\n"
+ "#ifdef A\n"
+ " 1);\n"
+ "#else\n"
+ " 2);\n"
+ "#endif",
----------------
owenca wrote:
Looks like both inner and outer braces can be inserted:
```c++
while (a) {
if (b) {
f(
#ifdef A
1);
#else
2);
#endif
}
}
```
https://github.com/llvm/llvm-project/pull/224947
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits