ClangFormat does not correctly handle an Objective-C interface declaration
with both lightweight generics and a protocol conformance.
This simple example:
@interface Foo : Bar <Baz> <Blech> @end
means Foo extends Bar (a lightweight generic class whose type
parameter is Baz) and also conforms to the protocol Blech.
ClangFormat should not apply any changes to the above example, but
instead it currently formats it quite poorly:
@interface Foo : Bar <Baz> <Blech> @end
The bug is that UnwrappedLineParser assumes an open-angle bracket
after a base class name is a protocol list, but it can also be a
lightweight generic specification.
This diff fixes the bug by factoring out the logic to parse
lightweight generics so it can apply both to the declared class
as well as the base class.
Test Plan: New tests added. Ran tests with:
% ninja FormatTests && ./tools/clang/unittests/Format/FormatTests Confirmed tests failed before diff and passed after diff.