clang-format behaviour w/ blank lines.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

clang-format behaviour w/ blank lines.

Tom Stellard via cfe-dev
#include <iostream>

    int


main(int    argc,char**argv    ) { std::cout <<"Hello"  ;    
}

is formatted by clang-format 3.9 (from debian, but confirmed w/ a 4.0 compiled by me) as:
[this w/ all default]

#include <iostream>

int


main(int    argc,char**argv    ) {
  std::cout << "Hello";
}

removing the extra white lines, hence starting from:

#include <iostream>

    int
main(int    argc,char**argv    ) { std::cout <<"Hello"  ;    
}

gives:

#include <iostream>

int main(int argc, char **argv) { std::cout << "Hello"; }

so it looks like extra blank lines prevents clang-format from reformatting anything at all, which is not what I would have expected.

Two question:

1. can other people confirm this, as it might be a quirk of my environment
2. is it intended? If it is only between type and function it is probably not a big deal in practice.

Thanks,

  Maurizio




_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...