owenpan added a comment.

The patch would have no effect if the `using` statement is not in a block, but 
that would probably be against C# syntax.

Please see my comments about the test cases. Otherwise, LGTM.



================
Comment at: clang/unittests/Format/FormatTestCSharp.cpp:168
 
+TEST_F(FormatTestCSharp, CSharpUsing) {
+  FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
----------------
I'd add the following as the first test case because it tests the new behavior. 
The other two test cases only verify that the patch does not cause regressions. 
(The `SBPO_Always` case may be redundant if it's already covered in 
`FormatTest.cpp`.)
```
  // SpaceBeforeParens: ControlStatements
  verifyFormat("public void foo() {\n"
               "  using (StreamWriter sw = new StreamWriter(filenameA)) {}\n"
               "}");
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66662/new/

https://reviews.llvm.org/D66662



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to