[cfe-commits] [PATCH] Format inline namespaces

Dmitri Gribenko gribozavr at gmail.com
Sun Dec 30 10:56:31 PST 2012


On Sun, Dec 30, 2012 at 8:52 PM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
>
> On 30.12.2012, at 19:41, Dmitri Gribenko wrote:
>
>> Hello,
>>
>> The attached patch teaches the formatter about inline namespaces.
>> This changes formatting from:
>>
>> inline namespace X {
>>  class A {
>>  };
>> }
>>
>> to:
>>
>> inline namespace X {
>> class A {
>> };
>> }
>
> Seems like a strange coding convention. Do we really want this?

This is how we currently format namespaces.  This patch is not about
whether we want indentation or not, it is about treating 'inline
namespace X' like a plain 'namespace X'.

And on the coding guidelines side -- yes, I think we do want this.
Imagine a header file:

namespace clang {
...lots of stuff...
} // end namespace clang

Everything in the namespace is usually not indented.

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the cfe-commits mailing list