[PATCH] Fix bug in clang-format while merging short function (PR19461)

Dinesh Dwivedi dinesh.d at samsung.com
Thu Apr 24 03:34:35 PDT 2014


*** updated comment for typos

Hi Klimek,

Thanks for review.

With this change, I am trying to figure out whether there is a "gap" in the line.
If this gap is just white spaces, that is not an issue and we can still merge
function. But if there are other constructs such as preprocessor directives, we
should not merge this function to single line.

During debugging, I have observed that if there are other constructs, block before
and after the construct (inclusive) are handled separately [Basically, I am trying
to say is I found TheLine->MustBeDeclaration to be false for 'after' block in such
cases]. I assumed, just checking for this case is good enough, as asserted from
test cases too.

If you think this is not correct, I will look in to code and try to find better fix.

Regards

http://reviews.llvm.org/D3439






More information about the cfe-commits mailing list