The wrapped closing parentheses below should not be but are indented: Foo::Foo( // ) : foo(0) {} int Foo::getter( // ) const { return foo; }
See https://reviews.llvm.org/D60374
Your saying the ')' should not be aligned to the // is that correct? Foo::Foo( // ) : foo(0) {} int Foo::getter( // ) const { return foo; }
I'd say the current behavior is more readable.
The current behavior is inconsistent: the closing parenthesis is not indented if not followed by colon or const.
Owen, Sorry I apologize if I'm not getting it straight away, but maybe I see it now so can you confirm, am I right in thinking what you are saying is If I have a function like bar() here, the the ) will be left aligned Foo::bar( // ) {} but if I have : or const it will be aligned with the // Foo::Foo( // ) : foo(0) {} int Foo::getter( // ) const { return foo; } Your fix is to always left align the ) in such circumstances so its consistent I think I agree with you that these 2 should be consistent void Foo::bar( // some comment ) {} void Foo::bar( // some comment ) const {} Given that they currently produce the following seems odd void Foo::bar( // some comment ) {} void Foo::bar( // some comment ) const {}
(In reply to MyDeveloperDay from comment #2) > Your saying the ')' should not be aligned to the // is that correct? > > Foo::Foo( > // > ) > : foo(0) {} > > int Foo::getter( > // > ) const { > return foo; > } Yes, and the bug lies in the inconsistency, at least in the case of const.
(In reply to MyDeveloperDay from comment #5) > Owen, Sorry I apologize if I'm not getting it straight away, but maybe I see > it now so can you confirm, am I right in thinking what you are saying is > > If I have a function like bar() here, the the ) will be left aligned > > Foo::bar( > // > ) {} > > but if I have : or const it will be aligned with the // > > Foo::Foo( > // > ) > : foo(0) {} > > int Foo::getter( > // > ) const { > return foo; > } > > Your fix is to always left align the ) in such circumstances so its > consistent Yes. :) > I think I agree with you that these 2 should be consistent > > void Foo::bar( // some comment > ) {} > > void Foo::bar( // some comment > ) const {} > > > Given that they currently produce the following seems odd > > void Foo::bar( // some comment > ) {} > > void Foo::bar( // some comment > ) const {} It's clear to me that we should fix it in the case of const but maybe should leave the colon case alone?