[cfe-dev] [clang-format] Issue with SpacesInParentheses with global namespace variables.

Darby Payne via cfe-dev cfe-dev at lists.llvm.org
Mon Mar 12 17:14:44 PDT 2018


Hi,

When SpacesInParentheses is set to true clang-format does not add a space
before a global namespace variable. For example, this is the output of
clang-format for a contrived exampled.

#include <iostream>


void print_val( std::ostream &s ) { s << "Hello world" << std::endl; }


int main( void ) {

  print_val(::std::cout );

  return 0;

}


The .clang-format looked like

Language:        Cpp

SpacesInParentheses: true


I have have a potential fix here https://reviews.llvm.org/D43957. It works
locally and passes the unit tests, but as this is my first time working
with this code base I am unsure of the procedure to follow for proposing
changes.


Regards,

-Darby
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180312/2a43c9cd/attachment.html>


More information about the cfe-dev mailing list