darwin marked 2 inline comments as done.
darwin added inline comments.
================
Comment at: clang/unittests/Format/FormatTest.cpp:280
+                   "}",
+                   CustomStyle));
+  EXPECT_EQ("/* something */ namespace N\n"
----------------
MyDeveloperDay wrote:
> I'm not sure I understand this.. why is this not
> 
> ```
> namespace N
> {
> int i;
> }
> ```
Because a namespace is different than a class or struct.

Please try this with chang-format:
```
darwin@Darwins-iMac Desktop % cat a.cpp 
namespace N {


int i;


}
darwin@Darwins-iMac Desktop % clang-format a.cpp -style="{BasedOnStyle: google}"
namespace N {

int i;

}
```
As you can see, clang-format removes the extra lines but still keeps one line 
at the beginning and the end of the namespace. This is the original behavior, I 
think it is very reasonable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104044

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

Reply via email to