diff options
author | sstwcw <su3e8a96kzlver@posteo.net> | 2025-10-03 20:40:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-03 20:40:48 +0000 |
commit | 2a059042882ed5108478c635322e4e94439386f5 (patch) | |
tree | f081dbc90e6db55dd7912f8cb76b5c6581c8353e /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 36dc2a941f531d6b5662f2ad2c11e7264e5d9622 (diff) | |
download | llvm-2a059042882ed5108478c635322e4e94439386f5.zip llvm-2a059042882ed5108478c635322e4e94439386f5.tar.gz llvm-2a059042882ed5108478c635322e4e94439386f5.tar.bz2 |
[clang-format] Keep the ObjC selector name and `@selector` together (#160739)
Fixes #36459.
after
```Objective-C
- (void)test {
if ([object
respondsToSelector:@selector(
selectorNameThatIsReallyLong:param1:param2:)])
return;
}
```
before
```Objective-C
- (void)test {
if ([object respondsToSelector:@selector
(selectorNameThatIsReallyLong:param1:param2:)])
return;
}
```
Before this patch, the `ObjCMethodExpr` type was assigned to many kinds
of tokens. The rule for allowing breaking the line before the colon on
line TokenAnnotator.cpp:6289 was intended for method declarations and
calls. It matched the parenthesis following `@selector` by mistake. To
fix the problem, this patch adds a new type for `@selector`. Most of the
special things in the code related to the old type is intended for other
constructs. So most of the code related to the old type is not changed
in this patch.
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions