{"push_id":2683839988,"size":1,"distinct_size":0,"ref":"refs/heads/master","head":"4c16104f9413dca35a39162c28f0ce421812f9c9","before":"cc3a6212f6b22d9fe27ffb4f2c97a8d324486982","commits":[{"sha":"4c16104f9413dca35a39162c28f0ce421812f9c9","author":{"name":"Ben Hamilton","email":"5756d6e03e0dd1ed1d8a33f5b60e167b46f9b71c@google.com"},"message":"[clang-format/ObjC] Fix NS_SWIFT_NAME(foo(bar:baz:)) after ObjC method decl\n\nSummary:\nIn D44638, I partially fixed `NS_SWIFT_NAME(foo(bar:baz:))`-style\nannotations on C functions, but didn't add a test for Objective-C\nmethod declarations.\n\nFor ObjC method declarations which are annotated with `NS_SWIFT_NAME(...)`,\nwe currently fail to annotate the final component of the selector\nname as `TT_SelectorName`.\n\nBecause the token type is left unknown, clang-format will happily\ncause a compilation error when it changes the following:\n\n```\n@interface Foo\n- (void)doStuffWithFoo:(id)name\n                   bar:(id)bar\n                   baz:(id)baz\n    NS_SWIFT_NAME(doStuff(withFoo:bar:baz:));\n@end\n```\n\nto:\n\n```\n@interface Foo\n- (void)doStuffWithFoo:(id)name\n                   bar:(id)bar\n                   baz:(id)baz\n    NS_SWIFT_NAME(doStuff(withFoo:bar:baz\n:));\n@end\n```\n\n(note the linebreak before the final `:`).\n\nThe logic which decides whether or not to annotate the token before a\n`:` with `TT_SelectorName` is pretty fragile, and has to handle some\npretty odd cases like pair-parameters:\n\n```\n[I drawRectOn:surface ofSize:aa:bbb atOrigin:cc:dd];\n```\n\nSo, to minimize the effect of this change, I decided to only annotate\nunknown identifiers before a `:` as `TT_SelectorName` for Objective-C\ndeclaration lines.\n\nTest Plan: New tests included. Confirmed tests failed before change and\n  passed after change. Ran tests with:\n  % make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests\n\nReviewers: djasper, krasimir, jolesiak\n\nReviewed By: krasimir\n\nSubscribers: cfe-commits\n\nDifferential Revision: https://reviews.llvm.org/D48679\n\ngit-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335983 91177308-0d34-0410-b5e6-96231b3b80d8","distinct":false,"url":"https://api.github.com/repos/fuchsia-mirror/third_party-clang/commits/4c16104f9413dca35a39162c28f0ce421812f9c9"}]}
{"actor":{"display_login":"fuchsia-infra-bot"}}