When I wrote ObjCHeaderStyleGuesser, I incorrectly assumed the
correct way to iterate over all tokens in AnnotatedLine was to
iterate over the linked list tokens starting with
AnnotatedLine::First.
However, AnnotatedLine also contains a vector
AnnotedLine::Children with child AnnotedLines which have their own
tokens which we need to iterate over.
Because I didn't iterate over the tokens in the children lines, the
ObjC style guesser would fail on syntax like:
#define FOO ({ NSString *s = ... })
as the statement(s) inside { ... } are child lines.
This fixes the bug and adds a test. I confirmed the test
failed before the fix, and passed after the fix.
Test Plan: New tests added. Ran tests with:
% make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Maybe choose a name that indicates what the bool result value means, e.g. LinesContainObjCCode or something.