[PATCH] D26493: [clang-move] Make the output code look more pretty.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 14 07:43:59 PST 2016


hokein added inline comments.


================
Comment at: clang-move/ClangMove.cpp:280
       assert(It < CurrentNamespaces.rend());
-      NewCode += "} // namespace " + *It + "\n";
+      NewCode += "} // namespace " + *It + "\n\n";
     }
----------------
hokein wrote:
> ioeric wrote:
> > Wouldn't this create something like:
> > ```
> > namespace x {
> > namespace y {
> > ...
> > } // namespace y
> >   <----------------------------extra \n.
> > } // namespace x
> > ```
> No. This code is for nested namespace. In your case, there should be a declaration after `} // namespace y` like:
> 
> ```
> namespace x {
> namespace y {
> ...
> } // namespace y
> 
> int A::f() {}
> } // namespace x
> ```
Oh, I see your meaning here. This case could be happened if the loop runs multiple times. Looking to it.


https://reviews.llvm.org/D26493





More information about the cfe-commits mailing list